Jekyll Pagination在每一页上

我们知道Jekyll默认分页只支持index.html,我想在那里创建blog.html include分页。

对此有何解决方案?

如果您创建一个名为/blog的目录并在其中放置一个index.html文件,那么您可以在_config.yml中添加一个设置为paginate_path: "blog/page:num" 。 不使用根文件夹中的默认index.html作为分页器模板, /blog/index.html使用/blog/index.html 。 分页器将根据需要生成/blog/page2//blog/page3//blog/page3/

这将使您访问yourwebsite.com/blog ,但如果您想访问yourwebsite.com/blog ,则可能需要使用重定向。