小编Heh*_*eho的帖子

Jekyll Paginator不工作

我目前正在一个基于jekyll的主页上工作,我不能让分页工作.

<ul class="posts">
    {% for post in paginator.posts %}
        <li>
            <span class="list_date">{{ post.date | date_to_string }}</span> &raquo; <span class="list_title"> {{ post.title }} </span><br>
            <span class="list_content">{{ post.content | strip_html | truncatewords:35}}</span> 
            <a href="{{ post.url }}">more...</a>
        </li>
    {% endfor %}
</ul>
Run Code Online (Sandbox Code Playgroud)

这是我的液体代码,它在使用网站而不是分页符时效果非常好.同样在我的_config.yml中我有这个部分:

paginate: 2
paginator_path: "news/page:num"
Run Code Online (Sandbox Code Playgroud)

由于index.html文件位于新闻文件夹中

html pagination liquid jekyll

23
推荐指数
2
解决办法
5840
查看次数

标签 统计

html ×1

jekyll ×1

liquid ×1

pagination ×1