【问题标题】:Stop post truncating Jekyll停止截断 Jekyll
【发布时间】:2020-03-15 10:07:59
【问题描述】:

我正在使用 jekyll 模板创建博客,目前所有帖子都被截断并带有阅读更多链接。 我希望删除它并完全显示任何长度的帖子。

这是我的 index.html

---
layout: default
---

{% for post in paginator.posts %}
<article class="main-article">
  <div class="wrap-content">
    <header class="header-article">
      <h2 class="title-article"><a href="{{post.url | prepend: site.baseurl}}">{{post.title}}</a></h2>
      <div class="post-date"><span>{{post.date | date: '%Y, %b %d'}}&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
    </header>
    {% if post.img %}
       <img class="post-image" src={{ "/assets/img/" | prepend: site.baseurl | append: post.img }} alt="{{post.title}}">
    {% endif %}
    <p>{{post.description}} <a class="more" href="{{post.url | prepend: site.baseurl}}">(Read more...)</a></p>
  </div>
</article>
{% endfor %}

<div class="pagination">
  {% if paginator.previous_page %}
    <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="previous"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</a>
  {% else %}
    <span class="previous"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</span>
  {% endif %}
  {% if paginator.next_page %}
    <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="next">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a>
  {% else %}
    <span class="next ">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></span>
  {% endif %}
</div>

非常感谢任何帮助

【问题讨论】:

    标签: html jekyll


    【解决方案1】:

    post.description 用于字体问题。在您的情况下,阅读更多链接到 post.url 是相关的帖子。在此处阅读有关真实摘录的更多信息:https://jekyllrb.com/docs/posts/#post-excerpts

    【讨论】:

      猜你喜欢
      • 2017-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-29
      • 1970-01-01
      • 2011-12-11
      • 2021-04-16
      • 2013-02-13
      相关资源
      最近更新 更多