jekyll:在打开的博客中显示标题和日期 post
jekyll: show title and date in opened blog post
我有一个博客索引页面,其中包含博客 post 和摘录列表。
单击 "read more" link 后,完整的博客 post 已打开,但缺少标题和创建日期。
博客索引的结构如下:
{% for post in paginator.posts %}
<div class="entry">
<h1>{{ post.title }}</h1>
<span class="date"><i class="fa fa-clock-o"></i> {{ post.date | date: "%m-%d-%Y"}}</span>
{{ post.excerpt }}
<a class="more-link" href="{{ post.url }}">continue reading <i class="fa fa-chevron-right"></i></a>
</div>
{% endfor %}
我试过在博客 post 中抛出 {{ post.title }}
和日期,无论是在文章的前面还是内联,但它只是显示为空。
如何在我打开的博客中显示标题post?
谢谢!
要编辑博客 post 的显示方式,您必须编辑 _layouts
文件夹中的模板文件。默认情况下,Jekyll 使用 post.html
作为博客 post 的模板。确保您在使用的布局文件中有 {{ page.title }}
并重新生成您的网站。现在,博客标题将出现在您所有的个人 post 页面上,请注意,如果 post 标题未在 post 的首页中指定,则不会出现。
我有一个博客索引页面,其中包含博客 post 和摘录列表。 单击 "read more" link 后,完整的博客 post 已打开,但缺少标题和创建日期。
博客索引的结构如下:
{% for post in paginator.posts %}
<div class="entry">
<h1>{{ post.title }}</h1>
<span class="date"><i class="fa fa-clock-o"></i> {{ post.date | date: "%m-%d-%Y"}}</span>
{{ post.excerpt }}
<a class="more-link" href="{{ post.url }}">continue reading <i class="fa fa-chevron-right"></i></a>
</div>
{% endfor %}
我试过在博客 post 中抛出 {{ post.title }}
和日期,无论是在文章的前面还是内联,但它只是显示为空。
如何在我打开的博客中显示标题post?
谢谢!
要编辑博客 post 的显示方式,您必须编辑 _layouts
文件夹中的模板文件。默认情况下,Jekyll 使用 post.html
作为博客 post 的模板。确保您在使用的布局文件中有 {{ page.title }}
并重新生成您的网站。现在,博客标题将出现在您所有的个人 post 页面上,请注意,如果 post 标题未在 post 的首页中指定,则不会出现。