Create tags and blog pages

This commit is contained in:
TheThomaas 2023-11-13 21:29:27 +01:00
parent ef7078f3b9
commit 31b2ac802f
3 changed files with 41 additions and 0 deletions

8
src/pages/blog.md Normal file
View file

@ -0,0 +1,8 @@
---
title: Blog
description: 'All blog posts can be found here'
layout: blog
permalink: /blog/index.html
---
Here, you can find every post of this blog

17
src/pages/tag.md Normal file
View file

@ -0,0 +1,17 @@
---
eleventyComputed:
title: "Posts tagged “{{ tag }}”"
permalink: '/tags/{{ tag | slug }}/'
pagination:
data: collections
size: 1
alias: tag
layout: base
---
# {{ title }}
{% set postslist = collections[ tag ] %}
{% include "partials/posts.njk" %}
View all [tags](/tags/).

16
src/pages/tags.md Normal file
View file

@ -0,0 +1,16 @@
---
title: Tags
permalink: /tags/
layout: base
---
# {{ title }}
<ul>
{% for tag in collections.all | getAllTags %}
{% set tagUrl %}/tags/{{ tag | slugify }}/{% endset %} <li>
<a href="{{ tagUrl }}">{{ tag }}</a>
</li> {% endfor %}
</ul>