在 Octopress 中,如何创建类似于博客文件夹的文件夹并列出存档文件?
In Octopress, how to create a folder similar as blog folder and list archives files?
我用 Octopress 写我的博客。
我喜欢写一些笔记,不想将它们发布为博客。
所以我在 source
文件夹中创建了一个名为 note
的折叠,并在其中放置了一些降价文件。 see source code structure
有效,但我不知道如何在一页中列出所有笔记档案的标题和link。现在我手动列出它们,see code.
我的问题是:
我的解决方案(创建一个新文件夹)是最好的方法吗?
如何编写代码列表文件而不是手动更新?
为此,您可以使用 jekyll collections。
在您的 _config.yml 中添加:
collections:
notes:
output: true
将您的 note
文件夹重命名为 _notes
现在您可以列出所有笔记:
<ul>
{% for note in site.notes %}
<li><a href="{{site.baseurl}}{{ note.url }}">{{ note.title }}</a></li>
{% endfor %}
</ul>
我用 Octopress 写我的博客。
我喜欢写一些笔记,不想将它们发布为博客。
所以我在 source
文件夹中创建了一个名为 note
的折叠,并在其中放置了一些降价文件。 see source code structure
有效,但我不知道如何在一页中列出所有笔记档案的标题和link。现在我手动列出它们,see code.
我的问题是:
我的解决方案(创建一个新文件夹)是最好的方法吗?
如何编写代码列表文件而不是手动更新?
为此,您可以使用 jekyll collections。
在您的 _config.yml 中添加:
collections:
notes:
output: true
将您的 note
文件夹重命名为 _notes
现在您可以列出所有笔记:
<ul>
{% for note in site.notes %}
<li><a href="{{site.baseurl}}{{ note.url }}">{{ note.title }}</a></li>
{% endfor %}
</ul>