diff options
Diffstat (limited to '_layouts')
-rw-r--r-- | _layouts/archive.html | 40 | ||||
-rw-r--r-- | _layouts/post.html | 13 |
2 files changed, 46 insertions, 7 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 %} diff --git a/_layouts/post.html b/_layouts/post.html index 3cddce3..d979adb 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -6,14 +6,13 @@ layout: default <header> <h1> {{ page.title }} - <br> - <small> - {% if page.wip %}Work in progress!{% endif %} - {% for tag in page.tags %} - #{{ tag }} - {% endfor %} - </small> + {% if page.wip %}<small>Work in progress!</small>{% endif %} </h1> + <small> + {% for tag in page.tags %} + <a href="{{ site.baseurl | prepend: site.url }}/tag/{{ tag | slugify }}">#{{ tag | slugify }}</a> + {% endfor %} + </small> </header> <main> {{ content }} |