网站主页上的幽灵博客 post

ghost blog post on website home page

我正在使用与我的网站集成的 ghost 博客 www.domainXX.com/blog.

我想在我的网站主页 page.Is 上显示一些 important/recent 博客,除了手动编写您的博客的简短描述代码然后将 link 提供给您的博客使用 html/css.

我查看了这个网站“https://www.nerdwallet.com/”,他们在 "must reads by our expert" 部分使用相同的概念。

谢谢。

是的,您可以使用 Ghost API 做到这一点。您可以编写一个 JavaScript 小部件,使用 ajax.

获取您最近的帖子
$.get(
    ghost.url.api('posts', {
      limit: 2, 
      include: 'count.posts', 
      order: 'count.posts DESC'
    })
  ).done(function (data) {
    console.log('Success!', data);
  });

http://themes.ghost.org/docs/ghost-api-ajax

仅供参考 ghost.url.api() 可能不在您的主页上,因此您需要从您的博客中引用它 https://www.nerdwallet.com/blog/shared/ghost-url.min.js

替代解决方案是生成指向您博客的嵌入式 RSS 小部件。 https://feed.mikle.com/