首页 > 解决方案 > Why Are Deleted Posts Showing Up in Paginated Posts in Jekyll Blog?

问题描述

I have a Jekyll blog. I deleted many of the blog posts because they were very old. However, they are still showing up in my categories (paginator.posts). Here's the code:

      <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 &raquo;</a>
          </p>
  </article>
{% endfor %}
</div> <!-- end post-list -->
    

Any ideas? Thanks in advance.

标签: paginationjekyllblogsposts

解决方案


推荐阅读