Pagination 为什么删除的帖子会出现在Jekyll博客的分页帖子中?
我有一个杰基尔博客。我删除了很多博客帖子,因为它们都很老了。然而,它们仍然出现在我的分类中(paginator.posts)。代码如下:Pagination 为什么删除的帖子会出现在Jekyll博客的分页帖子中?,pagination,jekyll,blogs,posts,Pagination,Jekyll,Blogs,Posts,我有一个杰基尔博客。我删除了很多博客帖子,因为它们都很老了。然而,它们仍然出现在我的分类中(paginator.posts)。代码如下: <div class="post-list"> {% for post in paginator.posts %} <article class="clearfix post type-post status-publish format-standard has-post-thumbnail&
<div class="post-list">
{% for post in paginator.posts %}
<article class="clearfix post type-post status-publish format-standard has-post-thumbnail">
<a href="{{ post.url }}" title="{{ post.title }}">
<h2 class="h2">{{ post.title | remove: "| SiteName" }}</h2>
</a>
<p class="meta">
{% assign d = post.date | date: "%-d" %}
{{ post.date | date: "%B" }}
{{ d }},
{{ post.date | date: "%Y" }}
{% if site.data.authors[post.author.login] %}
{% assign author = site.data.authors[post.author.login] %}
by <a href="{{ author.link }}" title="Posts by {{ author.name }}" rel="author">{{ author.name }}</a><br>
{% endif %}
</p>
<p>
{% if post.meta.thumbnail_asset and post.meta.thumbnail_alt %}
<a href="{{ post.url }}" title="{{ post.meta.thumbnail_alt }}">
{% asset '{{ post.meta.thumbnail_asset }}' alt='{{ post.meta.thumbnail_alt }}' class="wp-blog-thumbnail img-lt" %}
</a>
{% elsif post.meta.thumbnail_asset %}
<a href="{{ post.url }}" title="{{ post.title }}">
{% asset '{{ post.meta.thumbnail_asset }}' alt='{{ post.title | strip_html | truncatewords: 5 }}' class="wp-blog-thumbnail img-lt" %}
</a>
{% elsif post.meta.thumbnail_url and post.meta.thumbnail_alt %}
<a href="{{ post.url }}" title="{{ post.meta.thumbnail_alt }}">
<img src="{{ post.meta.thumbnail_url }}" class="wp-blog-thumbnail img-lt" alt="{{ post.meta.thumbnail_alt }}">
</a>
{% elsif post.meta.thumbnail_url %}
<a href="{{ post.url }}" title="{{ post.title }}">
<img src="{{ post.meta.thumbnail_url }}" class="wp-blog-thumbnail img-lt" alt="{{ post.title | strip_html | truncatewords: 5 }}">
</a>
{% endif %}
{% if post.description %}
{{ post.description }}..
{{ post.content | markdownify | strip_html | truncatewords: 55 }}
{% endif %}<a href="{{ post.url }}" title="{{ post.title }}">Read More »</a>
</p>
</article>
{% endfor %}
</div> <!-- end post-list -->
{paginator.posts%中的post为%s}
{%if post.meta.thumboil_资产和post.meta.thumboil_alt%}
{%elsif post.meta.thumbnail_asset%}
{%elsif post.meta.thumboil_url和post.meta.thumboil_alt%}
{%elsif post.meta.thumbnail_url%}
{%endif%}
{%if post.description%}
{{post.description}}。。
{{post.content | markdownify | strip | html | truncatewords:55}
{%endif%}
{%endfor%}
有什么想法吗?提前感谢。不确定您是如何删除帖子的,但文档中说:“除非某篇帖子已隐藏,否则在posts变量中的每篇帖子都要分页:在其首页为true。”我看到了这一点,但我已经删除了这些帖子,现在它们不在我的存储库中。在“类别”和“作者”页面上会显示缩略图和说明,但当您单击转到文章时,会显示404。不确定从何处获取信息。请共享更多代码在重新启动服务器之前是否尝试过运行
jekyll clean
?