我正在尝试设置 Jekyll,以便在侧边栏中显示帖子列表中第一个帖子的引用,但我不知道该怎么做。我quote
在每个帖子的 Markdown 中将引用文本定义为 YML Front Matter 中的变量。
这是我的default.html的相关摘录:
<div id="content">
{{ content }}
</div>
<div id="sidebar">
<blockquote>{{ page.quote }}</blockquote>
</div>
这是我的index.html:
---
layout: default
quote: ** Can a variable referencing the first post go here? **
---
{% for post in site.posts limit:10 %}
<h2>{{ post.title }}</h2>
<div class="post">
{{ post.content }}
</div>
{% endfor %}