我正面临Jekyll-paginate-v2这个奇怪的问题。paginator.posts 在本地工作,但是当我在 GitHub 存储库上更新站点时。它不适用于 index.html 和 blog.html (在_pages文件夹内)
这是文件,
_config.yml
pagination:
enabled: true
collection: 'posts'
permalink: '/page/:num/'
category: 'posts'
per_page: 3
sort_reverse: true
sort_field: 'date'
title: 'Blog'
limit: 0
tag: ''
trail:
before: 2
after: 2
extension: html
plugins:
- jekyll-sitemap
- jekyll-paginate-v2
- jekyll-redirect-from
索引.html
---
layout: default
pagination:
enabled: true
collection: posts
---
<div class="container">
<div class="row">
<div class="col-lg-12 mt-4">
<div class="row">
{% for post in paginator.posts %}
<div class="col-lg-4 my-5 post indexposts">
<img class="post-img img-fluid" title="{{post.title}}" alt="{{post.title}}" src="{{site.url}}/assets/img/posts/{{ post.slug }}/thumbnail.png">
<div class="post-body">
<div class="post-meta">
<a class="post-category tag" href="#">{{post.tags}}</a>
<span class="post-date"><time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">{{ post.date | date: "%b %-d, %Y" }}</time></span>
</div>
<h3 class="post-title"><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h3>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
这是我网站的链接。
我真的很感激任何帮助。提前致谢!