diff --git a/_config.yml b/_config.yml index 9398803..5389fc2 100644 --- a/_config.yml +++ b/_config.yml @@ -3,3 +3,8 @@ description: Collection of highlights from the books I have read over the years url: "https://books.sayan.ee" markdown: kramdown permalink: /:title +tag_mapping: + 1: "self-help" + 2: "spirituality" + 3: "fiction" + 4: "biography" diff --git a/_includes/tags.html b/_includes/tags.html new file mode 100644 index 0000000..ee7e29d --- /dev/null +++ b/_includes/tags.html @@ -0,0 +1,9 @@ +{% assign tag_mapping = site.tag_mapping %} +{% if post.tags %} +{% for tag_number in post.tags %} +{% assign tag_number = tag_number | plus: 1 | strip %} +{% if tag_mapping[tag_number] %} + {{ tag_mapping[tag_number] }} +{% endif %} +{% endfor %} +{% endif %} diff --git a/_layouts/post.html b/_layouts/post.html index 3014c52..de98bf5 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -36,6 +36,20 @@

{{ page.title }}

{% endif %} + + {% assign tag_mapping = site.tag_mapping %} + {% if page.tags %} + {% for tag_number in page.tags %} + {% assign tag_number = tag_number | plus: 1 | strip %} + {% if tag_mapping[tag_number] %} +
+
+ {{ tag_mapping[tag_number] }} +
+
+ {% endif %} + {% endfor %} + {% endif %} {{ content }} diff --git a/_posts/2021-11-10-siddhartha.md b/_posts/2021-11-10-siddhartha.md index 0108fc1..9039766 100644 --- a/_posts/2021-11-10-siddhartha.md +++ b/_posts/2021-11-10-siddhartha.md @@ -2,6 +2,7 @@ layout: post title: "Siddhartha" authors: Hermann Hesse +tags: [2,3] --- Awakening diff --git a/index.html b/index.html index 5457ae7..33e7936 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,8 @@ {{ post.title }} + {% include tags.html %} +

{% include info.html %}