diff options
| author | yingyu5658 <yingyu5658@outlook.com> | 2025-08-01 21:30:53 +0800 |
|---|---|---|
| committer | yingyu5658 <yingyu5658@outlook.com> | 2025-08-01 21:30:53 +0800 |
| commit | 70c5a2b6fb60bd90e7780fa220bfe146141d00e2 (patch) | |
| tree | 62e4c8e25b1c426c4f6ce21cf25e865445b176d4 /layouts/partials | |
| download | hugo-theme-concise-70c5a2b6fb60bd90e7780fa220bfe146141d00e2.tar.gz hugo-theme-concise-70c5a2b6fb60bd90e7780fa220bfe146141d00e2.zip | |
Initial commit
Diffstat (limited to 'layouts/partials')
| -rw-r--r-- | layouts/partials/footer.html | 5 | ||||
| -rw-r--r-- | layouts/partials/head.html | 1 | ||||
| -rw-r--r-- | layouts/partials/head/css.html | 1 | ||||
| -rw-r--r-- | layouts/partials/head/js.html | 1 | ||||
| -rw-r--r-- | layouts/partials/header.html | 1 | ||||
| -rw-r--r-- | layouts/partials/menu.html | 0 | ||||
| -rw-r--r-- | layouts/partials/pagination.html | 20 | ||||
| -rw-r--r-- | layouts/partials/terms.html | 11 |
8 files changed, 40 insertions, 0 deletions
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 @@ +<p>-----------------------------------</p> +{{ range .Site.Params.footer }} +<p>{{ . }}</p> +{{ end }} +<img src="/notbyai.png" class="not-by-ai" /> <br> 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 @@ +<meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title> {{ 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" }} <link rel="stylesheet" href="{{ .RelPermalink }}"> {{- else }} {{- with . | minify | fingerprint }} <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"> {{- 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 }} <script src="{{ .RelPermalink }}"></script> {{- end }} {{- else }} {{- $opts := dict "minify" true }} {{- with . | js.Build $opts | fingerprint }} <script src="{{ .RelPermalink }}" integrity="{{- .Data.Integrity }}" crossorigin="anonymous"></script> {{- 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 @@ +<h1 class="title">{{ site.Title }}</h1> <p class="subtitle">yingyu5658的数字花园</p> {{ 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 --- /dev/null +++ b/layouts/partials/menu.html 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 }} + <div class="custom-pagination"> + {{ if .HasPrev }} + <a href="{{ .Prev.URL }}">««</a> + <a href="{{ .Prev.URL }}">«</a> + {{ end }} + + {{ range .Pagers }} + <a class="{{ if eq .PageNumber $.PageNumber }}active{{ end }}" + href="{{ .URL }}">{{ .PageNumber }}</a> + {{ end }} + + {{ if .HasNext }} + <a href="{{ .Next.URL }}">»</a> + <a href="{{ .Next.URL }}">»»</a> + {{ end }} + </div> + {{ 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 }} +<div> + {{- range . }} + <a class="label" href="{{ .RelPermalink }}">#{{ .LinkTitle }}</a> + {{- end }} +</div> +{{- end }} |
