commit 332758f9c5ffc8b23783b32a58e2723e3081ad5a
parent 500d3ce1b7ede4f2a5a49ae40bb89abe46b13b72
Author: Michael Neuper <michael@michaelneuper.com>
Date: Wed, 1 Nov 2023 19:55:24 +0200
Add links to taxonomies
Diffstat:
6 files changed, 58 insertions(+), 16 deletions(-)
diff --git a/layouts/categories/terms.html b/layouts/categories/terms.html
@@ -0,0 +1,16 @@
+{{ define "main" }}
+<main id="main">
+ <h1>Categories</h1>
+ <br style="margin-bottom: 20px"></br>
+ <div class="row">
+ {{ range .Data.Terms.ByCount }}
+ <ul>
+ <li><a class="title is-5 is-size-6-mobile" href="{{ .Page.Permalink }}">{{ .Page.Title }}</a>
+ {{ $Totalpage:= len .Pages }}
+ {{ $Totalpage }} post{{ if ne $Totalpage 1 }}s{{ end }}
+ </li>
+ </ul>
+ {{ end }}
+ </div>
+</main>
+{{ end }}
+\ No newline at end of file
diff --git a/layouts/index.html b/layouts/index.html
@@ -11,14 +11,22 @@
</div>
<div class="sidebar">
- <h3>Categories</h3>
+ <h3 class="taxonomy"><a href="/categories/">Categories</a></h3>
<ul class="nav-list sidenav">
- {{ partial "categories.html" . }}
+ {{range first 10 ($.Site.GetPage "taxonomyTerm" "categories").Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{.Title}}</a>
+ </li>
+ {{ end }}
</ul>
<p></p>
- <h3>Tags</h3>
+ <h3 class="taxonomy"><a href="/tags/">Tags</a></h3>
<ul class="nav-list sidenav">
- {{ partial "tags.html" . }}
+ {{range first 10 ($.Site.GetPage "taxonomyTerm" "tags").Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{.Title}}</a>
+ </li>
+ {{ end }}
</ul>
</div>
</main>
diff --git a/layouts/partials/categories.html b/layouts/partials/categories.html
@@ -1,5 +0,0 @@
-{{range first 10 ($.Site.GetPage "taxonomyTerm" "categories").Pages }}
-<li>
- <a href="{{ .Permalink }}">{{.Title}}</a>
-</li>
-{{ end }}
-\ No newline at end of file
diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html
@@ -1,5 +0,0 @@
-{{range first 10 ($.Site.GetPage "taxonomyTerm" "tags").Pages }}
-<li>
- <a href="{{ .Permalink }}">{{.Title}}</a>
-</li>
-{{ end }}
-\ No newline at end of file
diff --git a/layouts/tags/terms.html b/layouts/tags/terms.html
@@ -0,0 +1,16 @@
+{{ define "main" }}
+<main id="main">
+ <h1>Tags</h1>
+ <br style="margin-bottom: 20px"></br>
+ <div class="row">
+ {{ range .Data.Terms.ByCount }}
+ <ul>
+ <li><a class="title is-5 is-size-6-mobile" href="{{ .Page.Permalink }}">{{ .Page.Title }}</a>
+ {{ $Totalpage:= len .Pages }}
+ {{ $Totalpage }} post{{ if ne $Totalpage 1 }}s{{ end }}
+ </li>
+ </ul>
+ {{ end }}
+ </div>
+</main>
+{{ end }}
+\ No newline at end of file
diff --git a/static/css/styles.css b/static/css/styles.css
@@ -258,6 +258,18 @@ header .current a {
color: var(--text-emphasized);
}
+h3.taxonomy > a {
+ color: var(--text);
+}
+
+h3.taxonomy > a:visited {
+ color: var(--text);
+}
+
+h3.taxonomy > a:hover {
+ color: var(--text-emphasized);
+}
+
.post-group a {
text-decoration: none;
transition: text-decoration 0.3s ease;