Explain how to override output collection index page (#6424)

Merge pull request 6424
This commit is contained in:
Goulven Champenois 2017-10-11 22:26:59 +02:00 committed by jekyllbot
parent 1bb36ebc9e
commit b3d607f264
1 changed files with 14 additions and 0 deletions

View File

@ -87,6 +87,20 @@ For example, if you have `_my_collection/some_subdir/some_doc.md`,
it will be rendered using Liquid and the Markdown converter of your it will be rendered using Liquid and the Markdown converter of your
choice and written out to `<dest>/my_collection/some_subdir/some_doc.html`. choice and written out to `<dest>/my_collection/some_subdir/some_doc.html`.
If you wish a specific page to be shown when accessing `/my_collection/`,
simply add `permalink: /my_collection/index.html` to a page.
To list items from the collection, on that page or any other, you can use:
{% raw %}
```liquid
{% for item in site.my_collection %}
<h2>{{ item.title }}</h2>
<p>{{ item.description }}</p>
<p><a href="{{ item.url }}">{{ item.title }}</a></p>
{% endfor %}
```
{% endraw %}
<div class="note info"> <div class="note info">
<h5>Don't forget to add YAML for processing</h5> <h5>Don't forget to add YAML for processing</h5>
<p> <p>