diff --git a/src/_includes/components/articleList.njk b/src/_includes/components/articleList.njk index d2dd2c7..83d8374 100644 --- a/src/_includes/components/articleList.njk +++ b/src/_includes/components/articleList.njk @@ -5,6 +5,7 @@

{{ article.data.title }}

+ {{ article.data.category }} diff --git a/src/_includes/components/categoryNav.njk b/src/_includes/components/categoryNav.njk new file mode 100644 index 0000000..a3a4bca --- /dev/null +++ b/src/_includes/components/categoryNav.njk @@ -0,0 +1,21 @@ +{% set categories = collections.categoryList %} + \ No newline at end of file diff --git a/src/_includes/layouts/article.njk b/src/_includes/layouts/article.njk index fc2e125..9c6c7d0 100644 --- a/src/_includes/layouts/article.njk +++ b/src/_includes/layouts/article.njk @@ -2,10 +2,11 @@ layout: page --- -
+

{{ title }}

Published: + {{ category }} {{ content | safe }}
\ No newline at end of file diff --git a/src/blog.njk b/src/blog.njk index 69920d5..e3b0965 100644 --- a/src/blog.njk +++ b/src/blog.njk @@ -11,7 +11,7 @@ pagination: ---

{{ title }}

- +{% include "./_includes/components/categoryNav.njk" %}

This view contains a list of all blogposts sorted from newest to oldest.

{% include "./_includes/components/articleList.njk" %} \ No newline at end of file diff --git a/src/category.njk b/src/category.njk new file mode 100644 index 0000000..eb207a5 --- /dev/null +++ b/src/category.njk @@ -0,0 +1,17 @@ +--- +layout: page +pagination: + data: collections.categoryList + size: 1 + alias: cat +permalink: "/blog/{{ cat.key }}/" +eleventyComputed: + title: Articles categorized under "{{ cat.name }}" +--- + + +

{{ title }}

+ +{% include "./_includes/components/categoryNav.njk" %} +{% set articles = collections.categories[cat.key] | reverse %} +{% include "./_includes/components/articleList.njk" %} \ No newline at end of file