From 709a407b2ef72327a6d2991ac7d03dbbbd510a3c Mon Sep 17 00:00:00 2001 From: Xin Date: Sun, 5 Jan 2025 20:33:56 +0000 Subject: [PATCH] feat: add tags support (#542) * feat: basic tags support * feat: add term page * chore: update css --- assets/css/compiled/main.css | 17 +++++++++++++++++ exampleSite/hugo_stats.json | 6 +++++- layouts/_default/taxonomy.html | 30 ++++++++++++++++++++++++++++++ layouts/_default/term.html | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 layouts/_default/taxonomy.html create mode 100644 layouts/_default/term.html diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index ee130305..5c10807c 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -839,6 +839,9 @@ video { -moz-appearance: none; appearance: none; } +.hx-grid-cols-1 { + grid-template-columns: repeat(1, minmax(0, 1fr)); +} .hx-flex-col { flex-direction: column; } @@ -3427,6 +3430,10 @@ body:is(html[class~="dark"] *) { flex-shrink: 0; } + .md\:hx-grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + .md\:hx-justify-start { justify-content: flex-start; } @@ -3456,11 +3463,21 @@ body:is(html[class~="dark"] *) { font-size: .875rem; } } +@media (min-width: 1024px) { + + .lg\:hx-grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } +} @media (min-width: 1280px) { .xl\:hx-block { display: block; } + + .xl\:hx-grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } } .ltr\:hx-right-1\.5:where([dir="ltr"], [dir="ltr"] *) { right: 0.375rem; diff --git a/exampleSite/hugo_stats.json b/exampleSite/hugo_stats.json index 65d58c9f..9cf76b0d 100644 --- a/exampleSite/hugo_stats.json +++ b/exampleSite/hugo_stats.json @@ -333,6 +333,7 @@ "hx-gap-x-1.5", "hx-gap-y-2", "hx-grid", + "hx-grid-cols-1", "hx-group", "hx-group/code", "hx-group/copybtn", @@ -545,6 +546,7 @@ "language-options", "language-switcher", "last-of-type:hx-mb-0", + "lg:hx-grid-cols-3", "lntable", "lntd", "ltr:before:hx-left-0", @@ -577,6 +579,7 @@ "max-sm:hx-grid-cols-1", "max-xl:hx-hidden", "md:hx-aspect-[1.1/1]", + "md:hx-grid-cols-2", "md:hx-h-[calc(100vh-var(--navbar-height)-var(--menu-height))]", "md:hx-hidden", "md:hx-inline-block", @@ -640,7 +643,8 @@ "subheading-anchor", "success-icon", "theme-toggle", - "xl:hx-block" + "xl:hx-block", + "xl:hx-grid-cols-4" ], "ids": null } diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 00000000..0cd7e063 --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,30 @@ +{{ define "main" }} +
+ {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }} + {{ partial "toc.html" (dict "Params" (dict "toc" false)) }} + +
+{{ end }} diff --git a/layouts/_default/term.html b/layouts/_default/term.html new file mode 100644 index 00000000..efcf9c82 --- /dev/null +++ b/layouts/_default/term.html @@ -0,0 +1,33 @@ +{{ define "main" }} +
+ {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }} + {{ partial "toc.html" (dict "Params" (dict "toc" false)) }} +
+
+
+ {{ if .Title }}

{{ .Title }}

{{ end }} +
+
+ {{ .Content }} +
+
+ {{- range .Pages -}} +
+

+ + {{ .Title }} + +

+

{{ partial "utils/format-date" .Date }}

+
+ {{- end -}} +
+
+
+
+{{ end }}