Merge pull request #9 from 11ty/tag-pages

Adds tag pages example
This commit is contained in:
Zach Leatherman authored and GitHub committed 2018-06-11 08:10:32 -05:00
commit af001c7a00
5 files changed
+25 -2

No files matched your search

+5 -1
View File
@@ -11,5 +11,9 @@
"author": {
"name": "Your Name Here",
"email": "youremailaddress@example.com"
}
},
"tagPages": [
"another-tag",
"second-tag"
]
}
+1 -1
View File
@@ -3,7 +3,7 @@
<li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<a href="{{ post.url | url }}" class="postlist-link">{{ post.data.title }}</a>
<span class="postlist-date">{{ post.date | readableDate }}</span>
{% for tag in post.data.tags %}{% if tag != "post" %}<span class="tag">{{ tag }}</span>{% endif %}{% endfor %}
{% for tag in post.data.tags %}{% if tag != "post" and metadata.tagPages.indexOf(tag) > -1 %}<a href="/tags/{{ tag }}/" class="tag">{{ tag }}</a>{% endif %}{% endfor %}
</li>
{% endfor %}
</ol>
+5
View File
@@ -168,6 +168,11 @@ pre {
background-color: var(--red);
color: var(--white);
border-radius: 0.25em; /* 3px /12 */
text-decoration: none;
}
a[href].tag,
a[href].tag:visited {
color: #fff;
}
/* Warning */
+1
View File
@@ -2,6 +2,7 @@
title: This is my third post.
tags:
- post
- second-tag
layout: layouts/post.njk
---
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.
+13
View File
@@ -0,0 +1,13 @@
---
pagination:
data: metadata.tagPages
size: 1
alias: tag
permalink: /tags/{{ tag }}/
layout: layouts/home.njk
---
<h1>Tagged “{{ tag }}”</h1>
{% set postslist = collections[ tag ] %}
{% include "postslist.njk" %}