我試圖在首頁上顯示帖子的摘錄,但它似乎只適用於一個帖子。摘錄插入這樣的:Jekyll僅在一個帖子中顯示摘錄
{% 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不會生成自動首段作爲摘錄。我其實很喜歡「第一段作爲摘錄」的東西,但它並沒有那樣做。我認爲這是我下載的主題中的問題,因爲默認主題不會導致這種奇怪的行爲。 – manabreak