我试图在jekyll中分页列出博客帖子,但似乎无法让它发挥作用。这是我的设置,我在根目录下有一个博客目录,它有一个index.md。我使用了来自jekyll网站的以下代码
<ul>
{% for post in paginator.posts %}
<li><h1><a href="{{ post.url }}">{{ post.title }}</a></h1></li>
{% endfor %}
</ul>我的_config.yml中有以下内容
paginate: 10什么都没显示出来。对于我在哪里搞砸有什么建议吗?
更新- Dir结构
$ls
_config.yml _layouts _site css index.html
_includes _posts
$ cd blog
$ ls
index.md发布于 2015-03-20 23:39:11
简单的解决方案:正如用杰基尔博士编写的那样,您必须提供一个index.html (即使是blog.html也不能工作)。
因此,只需将您的blog/index.md更改为blog/index.html,并在您的_config.yml中设置paginate_path: "/blog/page:num/"和paginate: 10,就可以了。
干杯..。
https://stackoverflow.com/questions/29159078
复制相似问题