简体   繁体   English

删除 Github Jekyll 中的“博客”部分

[英]Remove 'blog' section in the Github Jekyll

I am wondering how to use the Github Jekyll website without the 'Blog' section (that includes posts).我想知道如何在没有“博客”部分(包括帖子)的情况下使用 Github Jekyll 网站。 Could you share your solutions?你能分享你的解决方案吗? Thanks in advance.提前致谢。

I'll have to make the assumption that you have a blog page, either blog.html or blog/index.html , and in that page you have a for loop calling site.posts or paginator.posts .我必须假设您有一个博客页面, blog.htmlblog/index.html ,并且在该页面中有一个for循环调用site.postspaginator.posts You have two options:你有两个选择:

  1. Delete the _posts directory.删除_posts目录。
  2. If you want to keep the posts in _posts but don't want them to display on your site, don't use those for loops mentioned above and you won't see the posts on the frontend.如果您想将帖子保留在_posts中但不希望它们显示在您的网站上,请不要使用上面提到的那些for循环,您将不会在前端看到帖子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM