tag collections added
This commit is contained in:
parent
36ff1132a2
commit
5de802b090
2 changed files with 26 additions and 2 deletions
|
|
@ -5,4 +5,8 @@ layout: base
|
|||
<article>
|
||||
<h2>{{ title }}</h2>
|
||||
{{ content | safe }}
|
||||
{% for tag in tags %}
|
||||
{% set tagUrl %}/tags/{{ tag | slug }}/{% endset %}
|
||||
<a href="{{ tagUrl | url }}">{{ tag }}</a>
|
||||
{% endfor %}
|
||||
</article>
|
||||
|
|
|
|||
24
src/tags.njk
24
src/tags.njk
|
|
@ -1,3 +1,23 @@
|
|||
---
|
||||
layout: layouts/base
|
||||
---
|
||||
layout: base
|
||||
title: Tags
|
||||
pagination:
|
||||
data: collections
|
||||
size: 3
|
||||
alias: tag
|
||||
filter:
|
||||
- all
|
||||
permalink: /tags/{{ tag }}/
|
||||
---
|
||||
|
||||
<h2>Posts filed under “{{ tag }}”</h2>
|
||||
<ul>
|
||||
{% set postlist = collections[ tag ] %}
|
||||
{% for post in postlist | reverse %}
|
||||
<li>
|
||||
<a href="{{ post.url | url }}">{{ post.data.title }}</a>
|
||||
<time>{{ post.date }}</time>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p>See <a href="{{ '/tags/' | url }}">all tags</a>.</p>
|
||||
Loading…
Reference in a new issue