diff options
author | Patrick Spek <p.spek@tyil.nl> | 2020-06-10 11:01:19 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2020-06-10 11:01:19 +0200 |
commit | 13934914c0cf8bf359938dcc19dbea82fe33db61 (patch) | |
tree | 5c50f47555f10efd4beed8f2546e7146a91571c5 /_layouts/archive.html | |
parent | 624592d43e23bd26c3da30e255257b652d0e33ed (diff) |
Implement tag pages
Diffstat (limited to '_layouts/archive.html')
-rw-r--r-- | _layouts/archive.html | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/_layouts/archive.html b/_layouts/archive.html new file mode 100644 index 0000000..4c30f96 --- /dev/null +++ b/_layouts/archive.html @@ -0,0 +1,40 @@ +--- +layout: default +--- + +{% markdown %} +## Blog posts tagged with #{{ page.title | slugify }} +{% endmarkdown %} + +{% include posts-intro.md %} + +{% for post in page.posts %} + {% if post.wip %}{% continue %}{% endif %} + {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} + {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} + + {% if forloop.first %} + <h3>{{ this_year }}</h3> + <ul> + {% endif %} + + <li> + <a href="{{ post.url }}">{{ post.title }}</a> + <small> + {{ post.date | date: "%Y-%m-%d" }} + {% for tag in post.tags %} + <a href="{{ site.baseurl | prepend: site.url }}/tag/{{ tag | slugify }}">#{{ tag | slugify }}</a> + {% endfor %} + </small> + </li> + + {% if forloop.last %} + </ul> + {% else %} + {% if this_year != next_year %} + </ul> + <h3>{{ next_year }}</h3> + <ul> + {% endif %} + {% endif %} +{% endfor %} |