From 1147a663e70aadb2578cbe601bc723d7cd939c5a Mon Sep 17 00:00:00 2001 From: aethrvmn Date: Sat, 30 Aug 2025 15:17:32 +0200 Subject: added non-content --- themes/hugo-book/layouts/shortcodes/button.html | 12 ++++++++++++ themes/hugo-book/layouts/shortcodes/columns.html | 9 +++++++++ themes/hugo-book/layouts/shortcodes/details.html | 7 +++++++ themes/hugo-book/layouts/shortcodes/hint.html | 3 +++ themes/hugo-book/layouts/shortcodes/html.html | 1 + themes/hugo-book/layouts/shortcodes/i18n.html | 2 ++ themes/hugo-book/layouts/shortcodes/katex.html | 13 +++++++++++++ themes/hugo-book/layouts/shortcodes/mermaid.html | 12 ++++++++++++ themes/hugo-book/layouts/shortcodes/section.html | 13 +++++++++++++ themes/hugo-book/layouts/shortcodes/tab.html | 9 +++++++++ themes/hugo-book/layouts/shortcodes/tabs.html | 3 +++ 11 files changed, 84 insertions(+) create mode 100644 themes/hugo-book/layouts/shortcodes/button.html create mode 100644 themes/hugo-book/layouts/shortcodes/columns.html create mode 100644 themes/hugo-book/layouts/shortcodes/details.html create mode 100644 themes/hugo-book/layouts/shortcodes/hint.html create mode 100644 themes/hugo-book/layouts/shortcodes/html.html create mode 100644 themes/hugo-book/layouts/shortcodes/i18n.html create mode 100644 themes/hugo-book/layouts/shortcodes/katex.html create mode 100644 themes/hugo-book/layouts/shortcodes/mermaid.html create mode 100644 themes/hugo-book/layouts/shortcodes/section.html create mode 100644 themes/hugo-book/layouts/shortcodes/tab.html create mode 100644 themes/hugo-book/layouts/shortcodes/tabs.html (limited to 'themes/hugo-book/layouts/shortcodes') diff --git a/themes/hugo-book/layouts/shortcodes/button.html b/themes/hugo-book/layouts/shortcodes/button.html new file mode 100644 index 0000000..efae3e0 --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/button.html @@ -0,0 +1,12 @@ +{{- $ref := "" }} +{{- $target := "" -}} +{{- with .Get "href" -}} + {{- $ref = . -}} + {{- $target = "_blank" -}} +{{- end -}} +{{- with .Get "relref" -}} + {{- $ref = relref $ . -}} +{{- end -}} + + {{- .InnerDeindent -}} + diff --git a/themes/hugo-book/layouts/shortcodes/columns.html b/themes/hugo-book/layouts/shortcodes/columns.html new file mode 100644 index 0000000..bb01da9 --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/columns.html @@ -0,0 +1,9 @@ +{{- $ratio := (split (.Get "ratio") ":") -}} +
+{{ range $index, $content := split .InnerDeindent "<--->" }} + {{- $grow := default 1 (index $ratio $index) -}} +
+ {{ $content | safeHTML }} +
+{{ end }} +
diff --git a/themes/hugo-book/layouts/shortcodes/details.html b/themes/hugo-book/layouts/shortcodes/details.html new file mode 100644 index 0000000..a80209b --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/details.html @@ -0,0 +1,7 @@ +
+ {{- $summary := cond .IsNamedParams (.Get "title") (.Get 0) -}} + {{ $summary }} +
+ {{ .InnerDeindent | safeHTML }} +
+
diff --git a/themes/hugo-book/layouts/shortcodes/hint.html b/themes/hugo-book/layouts/shortcodes/hint.html new file mode 100644 index 0000000..95e4f83 --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/hint.html @@ -0,0 +1,3 @@ +
+ {{ .Inner | safeHTML }} +
diff --git a/themes/hugo-book/layouts/shortcodes/html.html b/themes/hugo-book/layouts/shortcodes/html.html new file mode 100644 index 0000000..b447d45 --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/html.html @@ -0,0 +1 @@ +{{- .Inner | safeHTML -}} \ No newline at end of file diff --git a/themes/hugo-book/layouts/shortcodes/i18n.html b/themes/hugo-book/layouts/shortcodes/i18n.html new file mode 100644 index 0000000..b65f70a --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/i18n.html @@ -0,0 +1,2 @@ +{{- $content := .Get 0 -}} +{{- default $content (i18n $content) -}} \ No newline at end of file diff --git a/themes/hugo-book/layouts/shortcodes/katex.html b/themes/hugo-book/layouts/shortcodes/katex.html new file mode 100644 index 0000000..4eafc35 --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/katex.html @@ -0,0 +1,13 @@ +{{- if not (.Page.Scratch.Get "katex") -}} + + + + +{{- .Page.Scratch.Set "katex" true -}} +{{- end -}} + + + {{ with .Get "display" }}\[{{else}}\({{end}} + {{- .InnerDeindent -}} + {{ with .Get "display" }}\]{{else}}\){{end}} + diff --git a/themes/hugo-book/layouts/shortcodes/mermaid.html b/themes/hugo-book/layouts/shortcodes/mermaid.html new file mode 100644 index 0000000..07a3bfc --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/mermaid.html @@ -0,0 +1,12 @@ +{{ if not (.Page.Scratch.Get "mermaid") }} + + +{{ with resources.Get "mermaid.json" }} + +{{ end }} +{{ .Page.Scratch.Set "mermaid" true }} +{{ end }} + +
+  {{- .Inner -}}
+
diff --git a/themes/hugo-book/layouts/shortcodes/section.html b/themes/hugo-book/layouts/shortcodes/section.html new file mode 100644 index 0000000..b700ec4 --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/section.html @@ -0,0 +1,13 @@ +{{- warnf "Section shortcode is deprecated and will be removed" -}} +
+{{ range .Page.Pages }} +
+ {{ partial "docs/title" . }} +
+ {{ if (in $.Params "summary") -}} +
+ {{ default .Summary .Description }} +
+ {{ end -}} +{{ end }} +
diff --git a/themes/hugo-book/layouts/shortcodes/tab.html b/themes/hugo-book/layouts/shortcodes/tab.html new file mode 100644 index 0000000..b5a753d --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/tab.html @@ -0,0 +1,9 @@ +{{- $group := printf "tabs-%v" (default .Parent.Ordinal (.Parent.Get 0)) -}} +{{- $tab := printf "%s-%d" $group .Ordinal }} + + +
+ {{- .Inner -}} +
diff --git a/themes/hugo-book/layouts/shortcodes/tabs.html b/themes/hugo-book/layouts/shortcodes/tabs.html new file mode 100644 index 0000000..fecbbeb --- /dev/null +++ b/themes/hugo-book/layouts/shortcodes/tabs.html @@ -0,0 +1,3 @@ +
+{{ .Inner }} +
-- cgit v1.2.3