From 70c5a2b6fb60bd90e7780fa220bfe146141d00e2 Mon Sep 17 00:00:00 2001 From: yingyu5658 Date: Fri, 1 Aug 2025 21:30:53 +0800 Subject: Initial commit --- layouts/partials/footer.html | 5 +++++ layouts/partials/head.html | 1 + layouts/partials/head/css.html | 1 + layouts/partials/head/js.html | 1 + layouts/partials/header.html | 1 + layouts/partials/menu.html | 0 layouts/partials/pagination.html | 20 ++++++++++++++++++++ layouts/partials/terms.html | 11 +++++++++++ 8 files changed, 40 insertions(+) create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/head/css.html create mode 100644 layouts/partials/head/js.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/menu.html create mode 100644 layouts/partials/pagination.html create mode 100644 layouts/partials/terms.html (limited to 'layouts/partials') diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..7fcbd79 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,5 @@ +

-----------------------------------

+{{ range .Site.Params.footer }} +

{{ . }}

+{{ end }} +
diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..c7d08d3 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1 @@ + {{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }} {{ partialCached "head/css.html" . }} {{ partialCached "head/js.html" . }} \ No newline at end of file diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html new file mode 100644 index 0000000..b260134 --- /dev/null +++ b/layouts/partials/head/css.html @@ -0,0 +1 @@ +{{- with resources.Get "css/main.css" }} {{- if eq hugo.Environment "development" }} {{- else }} {{- with . | minify | fingerprint }} {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html new file mode 100644 index 0000000..7a0d28d --- /dev/null +++ b/layouts/partials/head/js.html @@ -0,0 +1 @@ +{{- with resources.Get "js/main.js" }} {{- if eq hugo.Environment "development" }} {{- with . | js.Build }} {{- end }} {{- else }} {{- $opts := dict "minify" true }} {{- with . | js.Build $opts | fingerprint }} {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..696928e --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1 @@ +

{{ site.Title }}

yingyu5658的数字花园

{{ partial "menu.html" (dict "menuID" "main" "page" .) }} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..a59e79e --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,20 @@ +{{ with .Paginator }} + {{ if gt .TotalPages 1 }} +
+ {{ if .HasPrev }} + «« + « + {{ end }} + + {{ range .Pagers }} + {{ .PageNumber }} + {{ end }} + + {{ if .HasNext }} + » + »» + {{ end }} +
+ {{ end }} +{{ end }} diff --git a/layouts/partials/terms.html b/layouts/partials/terms.html new file mode 100644 index 0000000..02bf412 --- /dev/null +++ b/layouts/partials/terms.html @@ -0,0 +1,11 @@ +{{- /* For a given taxonomy, renders a list of terms assigned to the page. +@context {page} page The current page. @context {string} taxonomy The taxonomy. +@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} */}} {{- +$page := .page }} {{- $taxonomy := .taxonomy }} {{- with $page.GetTerms +$taxonomy }} {{- $label := (index . 0).Parent.LinkTitle }} +
+ {{- range . }} + #{{ .LinkTitle }} + {{- end }} +
+{{- end }} -- cgit v1.2.3