【发布时间】:2015-08-18 13:29:38
【问题描述】:
我试图在首页上显示帖子的摘录,但它似乎只适用于一篇帖子。摘录是这样插入的:
{% for post in paginator.posts %}
<div class="unit whole single-post-excerpt">
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<p class="description">{{ post.excerpt | strip_html }}</p>
</div>
{% endfor %}
帖子长这样,第一个叫"2015-08-17-first-post.markdown":
---
layout: post
title: "The first post that works"
---
This is the first post that has a working excerpt.
That was the excerpt, and this one won't show up in the list of posts.
These two paragraphs are shown on the post page instead.
第二个,叫"2015-08-18-second-post.markdown":
---
layout: post
title: "The second post that does not work"
---
This is the second post that does not work as intended.
This paragraph gets also added to the excerpt.
As does this one.
为什么第二篇文章的摘录没有按预期工作?我是否错过了配置中的某些内容或..?我还尝试添加更多帖子,并且摘录仅在第一个帖子上正常工作。所有后续帖子都有帖子列表中显示的所有文本,没有任何段落格式 - 都只是塞进一个段落。
【问题讨论】:
标签: jekyll