【问题标题】:Recent posts not showing up on Jekyll Pixyll theme最近的帖子没有显示在 Jekyll Pixyll 主题上
【发布时间】:2017-02-02 05:06:55
【问题描述】:

我正在开发一个个人网页,并且我将最新的 Pixyll 版本分叉到我的存储库中。我对_posts/2014-06-08-pixyll-has-pagination.md 进行了更改,并在标题中包含了以下属性

published: true
permalink: /test/

当我将我的 url 指向 webpage/test/ 时,我可以看到博客文章,但我无法在我的主页上看到它作为最近帖子的一部分。我的index.html如下:

---
layout: default
---
{% assign posts_count = (paginator.posts | size) %}

<div class="home">
  {% if posts_count > 0 %}
    <div class="posts">
      {% for post in paginator.posts %}
        <div class="post py3">
          <p class="post-meta">{{ post.date | date: site.date_format }}</p>
          <a href="{{ post.url | prepend: site.baseurl }}" class="post-link"><h3 class="h1 post-title">{{ post.title }}</h3></a>
          <p class="post-summary">
            {% if post.summary %}
              {{ post.summary }}
            {% else %}
              {{ post.excerpt }}
            {% endif %}
          </p>
        </div>
      {% endfor %}
    </div>

    {% include pagination.html %}
  {% else %}
    <h1 class='center'>{{ site.text.index.coming_soon }}</h3>
  {% endif %}
</div>

【问题讨论】:

  • 真的是 ruby​​-on rails 相关问题吗?

标签: html jekyll liquid


【解决方案1】:

pagination 就是这样工作的。

你有五个帖子:

_posts
├── 2015-07-11-announcing-pixyll-version-2.md
├── 2014-06-11-welcome-to-pixyll.markdown
├── 2014-06-10-see-pixyll-in-action.md
├── 2014-06-09-so-what-is-jekyll.md
└── 2014-06-08-pixyll-has-pagination.md

您的site.pagination 设置为4。

您的博客索引将显示前 4 个帖子,第 2 页将显示 第 5 个帖子 (2014-06-08-pixyll-has-pagination.md )

这里没有问题。

注意:在你的 _config.yml 中

  • 删除第一行的=======
  • 将github_username:lordlabakdas 更改为github_username: lordlabakdas 冒号后的空格
  • 将twitter_username:siddugan 更改为twitter_username: siddugan 冒号后的空格

【讨论】:

    猜你喜欢
    • 2013-07-27
    • 1970-01-01
    • 2020-08-22
    • 2017-07-28
    • 1970-01-01
    • 2015-06-04
    • 2020-08-27
    • 1970-01-01
    • 2012-06-07
    相关资源
    最近更新 更多