Creating a website with Jekyll that has a subdirectory for the blog with paginated content

冷暖自知 提交于 2019-12-03 16:57:47

I succeeded !

1 - Add in config.yml

paginate_path: "/blog/page:num"

2 - In you code :

{% for post in paginator.posts %}

and not

{% for post in paginated.posts %}

3 - A last subtle point. As seen at the bottom of the Jekyll variables doc

Paginator variable availability

These are only available in index files, however they can be located in a subdirectory, such as /blog/index.html.

So by renaming blog.html to blog/index.html, you finally get a working pagination for your blog.

Et voilà !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!