summaryrefslogtreecommitdiff
path: root/layouts/tags
diff options
context:
space:
mode:
authorArne Rief <riearn@proton.me>2025-08-16 22:42:03 +0200
committerArne Rief <riearn@proton.me>2025-08-16 22:42:03 +0200
commitf0506acd6f70da636b8fdb23439c85bbf2392b40 (patch)
treed9c4082aafa3e20a37174beecadcab54286f9cd9 /layouts/tags
parent1bf4d8aca6f81f2dddd0262e74b278cd9985b53d (diff)
HTML templates done
Diffstat (limited to 'layouts/tags')
-rw-r--r--layouts/tags/list.html37
-rw-r--r--layouts/tags/term.html42
2 files changed, 79 insertions, 0 deletions
diff --git a/layouts/tags/list.html b/layouts/tags/list.html
new file mode 100644
index 0000000..d3af0e4
--- /dev/null
+++ b/layouts/tags/list.html
@@ -0,0 +1,37 @@
+{{- /* List of All Tags */ -}}
+{{- define "main" }}
+<article class="tags-index">
+ <header class="tags-index__header">
+ <h1 class="tags-index__headline">
+ {{ lang.Translate "tags.all" | default "All Tags" }}
+ </h1>
+ <p class="tags-index__description">
+ {{ lang.Translate "tags.overview_all" | default "Overview of all topics covered on this site." }}
+ </p>
+ </header>
+
+ <section class="tags-index__content" aria-label="{{ lang.Translate "tags.all" | default "All Tags" }}">
+ {{- with site.Taxonomies.tags }}
+ {{ $tags := .Alphabetical }}
+ <ul class="tags-index__list">
+ {{- range $tags }}
+ <li class="tags-index__item">
+ <a href="{{ .Page.RelPermalink }}" class="tags-index__link" rel="tag">
+ <span class="tags-index__name">
+ {{ .Page.Title }}
+ </span>
+ <span class="tags-index__count" aria-label="{{ lang.Translate "tags.postcount_title" | default "Number of posts" }}">
+ ({{ .Count }})
+ </span>
+ </a>
+ </li>
+ {{- end }}
+ </ul>
+ {{- else }}
+ <p class="tags-index__empty">
+ {{ lang.Translate "tags.empty" | default "No tags found." }}
+ </p>
+ {{- end }}
+ </section>
+</article>
+{{- end }}
diff --git a/layouts/tags/term.html b/layouts/tags/term.html
new file mode 100644
index 0000000..e107123
--- /dev/null
+++ b/layouts/tags/term.html
@@ -0,0 +1,42 @@
+{{- /* List of All Articles for a Specific Tag */ -}}
+{{- define "main" }}
+<article class="tag-page">
+ <header class="tag-page__header">
+ <h1 class="tag-page__headline">
+ <span class="tag-page__label">
+ {{ lang.Translate "tags.tagged_with" | default "Tagged with:" }}
+ </span>
+ <span class="tag-page__name">
+ #{{ .Title }}
+ </span>
+ </h1>
+ <p class="tag-page__count">
+ {{ lang.Translate "tags.postcount_number" .Pages.Len | default (printf "%d posts found" .Pages.Len) }}
+ </p>
+ </header>
+
+ <section class="tag-page__content" aria-label="{{ lang.Translate "tags.posts_list" | default "Posts with this tag:" }}">
+ {{- with .Pages }}
+ <ul class="tag-page__posts">
+ {{- range . }}
+ <li class="tag-page__post">
+ {{- partial "list/post-card.html" . }}
+ </li>
+ {{- end }}
+ </ul>
+ {{- else }}
+ <p class="tag-page__empty">
+ {{ lang.Translate "tags.no_posts" | default "No posts found with this tag." }}
+ </p>
+ {{- end }}
+ </section>
+
+ <footer class="tag-page__footer">
+ <nav class="tag-page__navigation" aria-label="{{ lang.Translate "tags.navigation" | default "Tag navigation" }}">
+ <a href="{{ "/tags/" | relURL }}" class="tag-page__back-link">
+ ← {{ lang.Translate "tags.all_tags" | default "All tags" }}
+ </a>
+ </nav>
+ </footer>
+</article>
+{{- end }}