[英]ghost blog post on website home page
I am using ghost blog integrated with my website as www.domainXX.com/blog. 我正在使用与我的网站集成为www.domainXX.com/blog的幽灵博客。
I want to display few important/recent blog on my website's home page.Is there any way I can do that except writing short description code of your blog manually and then give link to your blog using html/css. 我想在我的网站首页上显示一些重要/最近的博客。除了手动编写简短的博客描述代码,然后使用html / css链接到我的博客之外,有什么方法可以做到这一点。
I checked this website " https://www.nerdwallet.com/ " and they are using the same concept under "must reads by our expert" section. 我检查了该网站“ https://www.nerdwallet.com/ ”,他们在“必须由我们的专家阅读”部分使用相同的概念。
Thanks. 谢谢。
Yes, you can do that with Ghost API. 是的,您可以使用Ghost API做到这一点。 You can write a JavaScript widget that fetches your recent posts with ajax. 您可以编写一个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 http://themes.ghost.org/docs/ghost-api-ajax
FYI ghost.url.api() might not be on your home website so you need reference it from your blog https://www.nerdwallet.com/blog/shared/ghost-url.min.js 仅供参考ghost.url.api()可能不在您的家庭网站上,因此您需要从博客https://www.nerdwallet.com/blog/shared/ghost-url.min.js引用它
Alternative solution would be to generate embedded RSS widget pointed to your blog. 另一种解决方案是生成指向您博客的嵌入式RSS小部件。 https://feed.mikle.com/ https://feed.mikle.com/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.