我的Jekyll站点中有以下文件夹结构:
...
_machine-learning
|- my-first-post.md
|- index.html
...我想安排我的网站,这样,当有人访问http://example.com/machine-learning/,他们可以看到所有的收集页面整齐列出。
为此,我将以下内容添加到我的index.html中
<h1 class="page-heading">Machine Learning</h1>
<ul class="post-list">
{% for item in site.machine-learning %}
<a href="{{ item.url | prepend: item.baseurl }}">{{ item.title }}</a>
{% endfor %}
</ul>这很好,但唯一的问题是,它也显示了我的index.html在那里,使一切看起来一团糟。
我在这里做错什么了吗?如何迭代我的集合,跳过索引?
发布于 2016-01-24 03:17:36
我刚刚更改了文件夹结构,将index.html文件从machine-learning/集合中移到根文件夹作为machine-learning.html。URL保持不变(example.com/机器学习),并且它不会出现在site.machine-learning列表中。
在此之前:
...
_machine-learning
|- my-first-post.md
|- index.html
...之后:
...
machine-learning.html
_machine-learning
|- my-first-post.md
...https://stackoverflow.com/questions/34961250
复制相似问题