From e03422873a1788137f120d9c8f34b2be079f0aee Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Fri, 2 Aug 2024 13:23:35 +0800 Subject: docs: build with hugo --- themes/hugo-xmag/layouts/_default/list.html | 52 +++++++++++++++++++++++++++ themes/hugo-xmag/layouts/_default/single.html | 41 +++++++++++++++++++++ themes/hugo-xmag/layouts/_default/terms.html | 22 ++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 themes/hugo-xmag/layouts/_default/list.html create mode 100644 themes/hugo-xmag/layouts/_default/single.html create mode 100644 themes/hugo-xmag/layouts/_default/terms.html (limited to 'themes/hugo-xmag/layouts/_default') diff --git a/themes/hugo-xmag/layouts/_default/list.html b/themes/hugo-xmag/layouts/_default/list.html new file mode 100644 index 0000000..5c1ac2c --- /dev/null +++ b/themes/hugo-xmag/layouts/_default/list.html @@ -0,0 +1,52 @@ +{{ partial "header.html" . }} + +
+
+{{ $pages := .Pages }} +{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }} +{{ $paginator := .Paginate (where $pages "Section" "!=" "") }} +{{ range $paginator.Pages }} +
+
+ {{ with .Params.categories }} + {{ range first 1 . }} + {{ . }} + {{ end }} + {{ else }} + {{ default "Uncategorized" .Site.Params.text.uncategorized }} + {{ end }} +
+

{{ .Title }}

+
+ {{ if .Params.author }}{{ partial "author_names.html" . }} / {{ end }} + {{ .Date.Format "2006-01-02" }} +
+ + {{ end }} + {{ end }} + {{ end }} + {{ with .Description }} + {{ $.Scratch.Set "summary" (markdownify .) }} + {{ else }} + {{ $.Scratch.Set "summary" ((delimit (findRE "((.|\n)*?

\\s*)+" .Content) "[…] ") | plainify | truncate (default 200 .Site.Params.summary_length) (default " …" .Site.Params.text.truncated ) | replaceRE "&" "&" | safeHTML) }} + {{ end }} + {{ $.Scratch.Get "summary" }} +
+
+ +{{ end }} + + + + +{{ partial "footer.html" . }} diff --git a/themes/hugo-xmag/layouts/_default/single.html b/themes/hugo-xmag/layouts/_default/single.html new file mode 100644 index 0000000..173ec3b --- /dev/null +++ b/themes/hugo-xmag/layouts/_default/single.html @@ -0,0 +1,41 @@ +{{ partial "header.html" . }} +
+
+ + +{{ if .Params.toc }} +{{ .TableOfContents }} +{{ end }} + +
+{{ .Content }} +
+ +{{ partial "author.html" . }} +{{ partial "info.html" . }} +{{ partial "prev_next.html" . }} +{{ partial "comments.html" . }} +
+
+ +{{ partial "footer.html" . }} diff --git a/themes/hugo-xmag/layouts/_default/terms.html b/themes/hugo-xmag/layouts/_default/terms.html new file mode 100644 index 0000000..2f432ed --- /dev/null +++ b/themes/hugo-xmag/layouts/_default/terms.html @@ -0,0 +1,22 @@ +{{ partial "header.html" . }} + +
+
+
+

{{ $.Scratch.Get "Title" }}

+ +
    + {{ range $key, $value := .Data.Terms }} +
  • + + {{ $key }} + + ({{ len $value }}) +
  • + {{ end }} +
+
+
+
+ +{{ partial "footer.html" . }} -- cgit v1.2.3-70-g09d2