
<div > <ul > <!-- This loops through the paginated posts --> {% for post in paginator.posts %} <h1><a href="{{ post.url }}">{{ post.Title }}</a></h1> <p > <span >{{ post.date }}</span> </p> <div > {{ post.content }} </div> {% endfor %} {% if paginator.total_pages > 1 %} <div > {% if paginator.prevIoUs_page %} <a href="{{ paginator.prevIoUs_page_path | prepend: site.baseurl | replace: '//','/' }}">« Prev</a> {% else %} <span>« Prev</span> {% endif %} {% for page in (1..paginator.total_pages) %} {% if page == paginator.page %} <em>{{ page }}</em> {% elsif page == 1 %} <a href="{{ '/index.HTML' | prepend: site.baseurl | replace: '//','/' }}">{{ page }}</a> {% else %} <a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//','/' | replace: ':num',page }}">{{ page }}</a> {% endif %} {% endfor %} {% if paginator.next_page %} <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//','/' }}">Next »</a> {% else %} <span>Next »</span> {% endif %}</div>{% endif %} </ul> </div> 但是,当我尝试将其添加到/pages/Blog.HTML页面时,它不起作用.它没有显示我的_posts目录中的任何帖子,而是生成并清空容器.我假设这是一个路径问题.
我已根据需要将YAML标头添加到Blog.HTML文件中.呈现页面时,它会生成一个空容器.
解决方法 如果你想要一个类似于/ pages / Blog /的网址列表:>通过在_config.yml中设置paginate:5来激活分页>在_config.yml中设置paginate_path:pages / Blog / page:num>将/pages/Blog.HTML重命名为pages / Blog / index.HTML
总结以上是内存溢出为你收集整理的Jekyll博客在非index.html页面上发布全部内容,希望文章能够帮你解决Jekyll博客在非index.html页面上发布所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)