我有一个章鱼网站,其中有帖子和页面。现在,我想添加另一个类别的页面,我想称呼为writepus
(注释我将继续通过git consits像Wiki一样更新)。
我想将这些笔记保存在一个称为_notes
的文件夹中,就像我们在章鱼的source
中有_posts
一样。
我有一个名为_writeups/
的文件夹,其中包括:
subject1.html
subject2.html
我有一个名为notes/list.html
的文件,其中包含以下内容。
---
layout: page
navbar: Notes
title: Notes
footer: false
---
<div id="blog-archives">
{% for post in site.writeups reverse %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% unless year == this_year %}
{% assign year = this_year %}
<h2>{{ year }}</h2>
{% endunless %}
<article class="page-header">
{% include archive_post.html %}
</article>
{% endfor %}
</div>
基本上,我想创建这些写入的列表,以便我可以在时间时继续对其进行更新。我也想将这些与posts
和pages
分开。
如何使用Octopress/Jekyll实现此功能?
jekyll版本2,直到最近才发布,具有额外的收集和数据。收藏可能是您要寻找的内容,因此请升级您的Jekyll版本并访问http://jekyllrb.com/docs/collections/以了解有关它们的更多信息。