From 0d6c92124e6e21a536de6711ab5f82fa88200194 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 2 Dec 2024 17:20:09 -0800 Subject: basic setup for tags --- config.toml | 6 +++++- content/blog/no-ssh-to-prod.md | 10 ++++++---- templates/index.html | 6 ++++++ templates/page.html | 8 ++++++++ templates/tags/list.html | 12 ++++++++++++ templates/tags/single.html | 12 ++++++++++++ 6 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 templates/tags/list.html create mode 100644 templates/tags/single.html diff --git a/config.toml b/config.toml index 88f9a3e..fd294a2 100644 --- a/config.toml +++ b/config.toml @@ -11,9 +11,13 @@ default_language = "en" generate_feeds = true feed_filenames = ["feed.xml"] +taxonomies = [ + {name = "tags", feed = false}, +] + [markdown] highlight_code = true -highlight_theme = "zenburn" +highlight_theme = "one-dark" render_emoji = true smart_punctuation = true diff --git a/content/blog/no-ssh-to-prod.md b/content/blog/no-ssh-to-prod.md index 71ad595..9c2d20a 100644 --- a/content/blog/no-ssh-to-prod.md +++ b/content/blog/no-ssh-to-prod.md @@ -1,7 +1,9 @@ ---- -title: No SSH to production -date: 2022-11-28 ---- ++++ +title = "No SSH to production" +date = 2022-11-28 +[taxonomies] +tags = ["practices"] ++++ It's not uncommon to hear talk about preventing engineers to SSH to production machines. While I think it's a noble goal, I think most organizations are not ready for it in the short or even medium term. diff --git a/templates/index.html b/templates/index.html index 9c8f98d..f1a8cbe 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,4 +6,10 @@ {{ section.content | safe }} {% endif %} +

Tags

+{% set blogtags = get_taxonomy(kind="tags") %} +{% for tag in blogtags.items %} +#{{ tag.name }} +{% endfor %} + {%- endblock content -%} diff --git a/templates/page.html b/templates/page.html index ab19904..3474a07 100644 --- a/templates/page.html +++ b/templates/page.html @@ -5,6 +5,14 @@ {% block content -%}

{{ page.title }}

+{% if page.taxonomies.tags %} +
+ {% for tag in page.taxonomies.tags %} + #{{ tag }} + {% endfor %} +
+{% endif %} + {{ page.content | safe -}}

{{ page.date | date(format="%B %d, %Y") }}

diff --git a/templates/tags/list.html b/templates/tags/list.html new file mode 100644 index 0000000..b7f904a --- /dev/null +++ b/templates/tags/list.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block content %} +

Tags

+ +{% endblock content %} diff --git a/templates/tags/single.html b/templates/tags/single.html new file mode 100644 index 0000000..b276f93 --- /dev/null +++ b/templates/tags/single.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block content %} +

Tag: {{ term.name }}

+ +{% endblock content %} -- cgit v1.2.3