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/404.html | 34 +++++++++ .../layouts/_default/_markup/render-heading.html | 4 ++ .../layouts/_default/_markup/render-image.html | 19 +++++ .../layouts/_default/_markup/render-link.html | 29 ++++++++ themes/hugo-book/layouts/_default/baseof.html | 83 ++++++++++++++++++++++ themes/hugo-book/layouts/_default/list.html | 1 + themes/hugo-book/layouts/_default/single.html | 1 + themes/hugo-book/layouts/partials/docs/brand.html | 8 +++ .../hugo-book/layouts/partials/docs/comments.html | 2 + themes/hugo-book/layouts/partials/docs/date.html | 6 ++ themes/hugo-book/layouts/partials/docs/footer.html | 27 +++++++ themes/hugo-book/layouts/partials/docs/header.html | 13 ++++ .../layouts/partials/docs/html-head-favicon.html | 1 + .../layouts/partials/docs/html-head-title.html | 1 + .../hugo-book/layouts/partials/docs/html-head.html | 56 +++++++++++++++ .../layouts/partials/docs/inject/body.html | 0 .../partials/docs/inject/content-after.html | 0 .../partials/docs/inject/content-before.html | 0 .../layouts/partials/docs/inject/footer.html | 0 .../layouts/partials/docs/inject/head.html | 0 .../layouts/partials/docs/inject/menu-after.html | 0 .../layouts/partials/docs/inject/menu-before.html | 0 .../layouts/partials/docs/inject/toc-after.html | 0 .../layouts/partials/docs/inject/toc-before.html | 0 .../hugo-book/layouts/partials/docs/languages.html | 33 +++++++++ .../layouts/partials/docs/links/commit.html | 2 + .../layouts/partials/docs/links/edit.html | 2 + .../layouts/partials/docs/menu-filetree.html | 49 +++++++++++++ .../hugo-book/layouts/partials/docs/menu-hugo.html | 28 ++++++++ themes/hugo-book/layouts/partials/docs/menu.html | 21 ++++++ .../hugo-book/layouts/partials/docs/post-meta.html | 16 +++++ themes/hugo-book/layouts/partials/docs/search.html | 8 +++ .../hugo-book/layouts/partials/docs/taxonomy.html | 19 +++++ themes/hugo-book/layouts/partials/docs/title.html | 17 +++++ themes/hugo-book/layouts/partials/docs/toc.html | 3 + themes/hugo-book/layouts/posts/list.html | 22 ++++++ themes/hugo-book/layouts/posts/single.html | 15 ++++ 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 + themes/hugo-book/layouts/taxonomy/list.html | 13 ++++ themes/hugo-book/layouts/taxonomy/taxonomy.html | 22 ++++++ 50 files changed, 639 insertions(+) create mode 100644 themes/hugo-book/layouts/404.html create mode 100644 themes/hugo-book/layouts/_default/_markup/render-heading.html create mode 100644 themes/hugo-book/layouts/_default/_markup/render-image.html create mode 100644 themes/hugo-book/layouts/_default/_markup/render-link.html create mode 100644 themes/hugo-book/layouts/_default/baseof.html create mode 100644 themes/hugo-book/layouts/_default/list.html create mode 100644 themes/hugo-book/layouts/_default/single.html create mode 100644 themes/hugo-book/layouts/partials/docs/brand.html create mode 100644 themes/hugo-book/layouts/partials/docs/comments.html create mode 100644 themes/hugo-book/layouts/partials/docs/date.html create mode 100644 themes/hugo-book/layouts/partials/docs/footer.html create mode 100644 themes/hugo-book/layouts/partials/docs/header.html create mode 100644 themes/hugo-book/layouts/partials/docs/html-head-favicon.html create mode 100644 themes/hugo-book/layouts/partials/docs/html-head-title.html create mode 100644 themes/hugo-book/layouts/partials/docs/html-head.html create mode 100644 themes/hugo-book/layouts/partials/docs/inject/body.html create mode 100644 themes/hugo-book/layouts/partials/docs/inject/content-after.html create mode 100644 themes/hugo-book/layouts/partials/docs/inject/content-before.html create mode 100644 themes/hugo-book/layouts/partials/docs/inject/footer.html create mode 100644 themes/hugo-book/layouts/partials/docs/inject/head.html create mode 100644 themes/hugo-book/layouts/partials/docs/inject/menu-after.html create mode 100644 themes/hugo-book/layouts/partials/docs/inject/menu-before.html create mode 100644 themes/hugo-book/layouts/partials/docs/inject/toc-after.html create mode 100644 themes/hugo-book/layouts/partials/docs/inject/toc-before.html create mode 100644 themes/hugo-book/layouts/partials/docs/languages.html create mode 100644 themes/hugo-book/layouts/partials/docs/links/commit.html create mode 100644 themes/hugo-book/layouts/partials/docs/links/edit.html create mode 100644 themes/hugo-book/layouts/partials/docs/menu-filetree.html create mode 100644 themes/hugo-book/layouts/partials/docs/menu-hugo.html create mode 100644 themes/hugo-book/layouts/partials/docs/menu.html create mode 100644 themes/hugo-book/layouts/partials/docs/post-meta.html create mode 100644 themes/hugo-book/layouts/partials/docs/search.html create mode 100644 themes/hugo-book/layouts/partials/docs/taxonomy.html create mode 100644 themes/hugo-book/layouts/partials/docs/title.html create mode 100644 themes/hugo-book/layouts/partials/docs/toc.html create mode 100644 themes/hugo-book/layouts/posts/list.html create mode 100644 themes/hugo-book/layouts/posts/single.html 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 create mode 100644 themes/hugo-book/layouts/taxonomy/list.html create mode 100644 themes/hugo-book/layouts/taxonomy/taxonomy.html (limited to 'themes/hugo-book/layouts') diff --git a/themes/hugo-book/layouts/404.html b/themes/hugo-book/layouts/404.html new file mode 100644 index 0000000..909430e --- /dev/null +++ b/themes/hugo-book/layouts/404.html @@ -0,0 +1,34 @@ + + + + + {{ partial "docs/html-head" . }} + {{ partial "docs/inject/head" . }} + + + + + +
+
+

404

+

Page Not Found

+

+ {{ .Site.Title }} +

+
+
+ + {{ partial "docs/inject/body" . }} + + + diff --git a/themes/hugo-book/layouts/_default/_markup/render-heading.html b/themes/hugo-book/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..5439d20 --- /dev/null +++ b/themes/hugo-book/layouts/_default/_markup/render-heading.html @@ -0,0 +1,4 @@ + + {{ .Text | safeHTML }} + # + diff --git a/themes/hugo-book/layouts/_default/_markup/render-image.html b/themes/hugo-book/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..148cbaf --- /dev/null +++ b/themes/hugo-book/layouts/_default/_markup/render-image.html @@ -0,0 +1,19 @@ +{{- if .Page.Site.Params.BookPortableLinks -}} + {{- template "portable-image" . -}} +{{- else -}} + {{ .Text }} +{{- end -}} + +{{- define "portable-image" -}} + {{- $isRemote := or (in .Destination "://") (strings.HasPrefix .Destination "//") }} + {{- if not $isRemote }} + {{- $path := print .Page.File.Dir .Destination }} + {{- if strings.HasPrefix .Destination "/" }} + {{- $path = print "/static" .Destination }} + {{- end }} + {{- if not (fileExists $path) }} + {{- warnf "Image '%s' not found in '%s'" .Destination .Page.File }} + {{- end }} + {{- end }} + {{ .Text }} +{{- end -}} diff --git a/themes/hugo-book/layouts/_default/_markup/render-link.html b/themes/hugo-book/layouts/_default/_markup/render-link.html new file mode 100644 index 0000000..288d81c --- /dev/null +++ b/themes/hugo-book/layouts/_default/_markup/render-link.html @@ -0,0 +1,29 @@ +{{- if .Page.Site.Params.BookPortableLinks -}} + {{- template "portable-link" . -}} +{{- else -}} + {{ .Text | safeHTML }} +{{- end -}} + +{{- define "portable-link" -}} + {{- $destination := .Destination }} + {{- $isRemote := or (in .Destination ":") (strings.HasPrefix .Destination "//") }} + {{- $isFragment := strings.HasPrefix .Destination "#" }} + {{- if and (not $isRemote) (not $isFragment) }} + {{- $url := urls.Parse .Destination }} + {{- $path := strings.TrimSuffix "/_index.md" $url.Path }} + {{- $path = strings.TrimSuffix "/_index" $path }} + {{- $path = strings.TrimSuffix ".md" $path }} + {{- $page := .Page.GetPage $path }} + {{- if $page }} + {{- $destination = $page.RelPermalink }} + {{- if $url.Fragment }} + {{- $destination = print $destination "#" $url.Fragment }} + {{- end }} + {{- else if fileExists (print .Page.File.Dir .Destination) }} + + {{- else -}} + {{- warnf "Page '%s' not found in '%s'" .Destination .Page.File }} + {{- end }} + {{- end }} + {{ .Text | safeHTML }} +{{- end -}} diff --git a/themes/hugo-book/layouts/_default/baseof.html b/themes/hugo-book/layouts/_default/baseof.html new file mode 100644 index 0000000..a6c4c07 --- /dev/null +++ b/themes/hugo-book/layouts/_default/baseof.html @@ -0,0 +1,83 @@ + + + + {{ partial "docs/html-head" . }} + {{ partial "docs/inject/head" . }} + + + + +
+ + +
+
+ {{ template "header" . }} +
+ + {{ partial "docs/inject/content-before" . }} + {{ template "main" . }} + {{ partial "docs/inject/content-after" . }} + +
+ {{ template "footer" . }} + {{ partial "docs/inject/footer" . }} +
+ + {{ template "comments" . }} + + +
+ + {{ if default true (default .Site.Params.BookToC .Params.BookToC) }} + + {{ end }} +
+ + {{ partial "docs/inject/body" . }} + + + +{{ define "menu" }} + {{ partial "docs/menu" . }} +{{ end }} + +{{ define "header" }} + {{ partial "docs/header" . }} + + {{ if default true (default .Site.Params.BookToC .Params.BookToC) }} + + {{ end }} +{{ end }} + +{{ define "footer" }} + {{ partial "docs/footer" . }} +{{ end }} + +{{ define "comments" }} + {{ if and .Content (default true (default .Site.Params.BookComments .Params.BookComments)) }} +
+ {{- partial "docs/comments" . -}} +
+ {{ end }} +{{ end }} + +{{ define "main" }} +
+ {{- .Content -}} +
+{{ end }} + +{{ define "toc" }} + {{ partial "docs/toc" . }} +{{ end }} diff --git a/themes/hugo-book/layouts/_default/list.html b/themes/hugo-book/layouts/_default/list.html new file mode 100644 index 0000000..0dc8b68 --- /dev/null +++ b/themes/hugo-book/layouts/_default/list.html @@ -0,0 +1 @@ +{{ define "dummy" }}{{ end }} diff --git a/themes/hugo-book/layouts/_default/single.html b/themes/hugo-book/layouts/_default/single.html new file mode 100644 index 0000000..0dc8b68 --- /dev/null +++ b/themes/hugo-book/layouts/_default/single.html @@ -0,0 +1 @@ +{{ define "dummy" }}{{ end }} diff --git a/themes/hugo-book/layouts/partials/docs/brand.html b/themes/hugo-book/layouts/partials/docs/brand.html new file mode 100644 index 0000000..fa7f415 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/brand.html @@ -0,0 +1,8 @@ +

+ + {{- with .Site.Params.BookLogo -}} + Logo + {{- end -}} + {{ .Site.Title }} + +

diff --git a/themes/hugo-book/layouts/partials/docs/comments.html b/themes/hugo-book/layouts/partials/docs/comments.html new file mode 100644 index 0000000..59c5f22 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/comments.html @@ -0,0 +1,2 @@ + +{{ template "_internal/disqus.html" . }} diff --git a/themes/hugo-book/layouts/partials/docs/date.html b/themes/hugo-book/layouts/partials/docs/date.html new file mode 100644 index 0000000..8c75361 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/date.html @@ -0,0 +1,6 @@ + +{{- $format := default "January 2, 2006" .Format -}} +{{- return (time.Format $format .Date) -}} diff --git a/themes/hugo-book/layouts/partials/docs/footer.html b/themes/hugo-book/layouts/partials/docs/footer.html new file mode 100644 index 0000000..77e96d8 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/footer.html @@ -0,0 +1,27 @@ +
+ +{{ if and .GitInfo .Site.Params.BookRepo }} +
+ {{- $date := partial "docs/date" (dict "Date" .GitInfo.AuthorDate.Local "Format" .Site.Params.BookDateFormat) -}} + + + {{ $date }} + +
+{{ end }} + +{{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }} +
+ + + {{ i18n "Edit this page" }} + +
+{{ end }} + +
+ +{{ $script := resources.Get "clipboard.js" | resources.Minify }} +{{ with $script.Content }} + +{{ end }} diff --git a/themes/hugo-book/layouts/partials/docs/header.html b/themes/hugo-book/layouts/partials/docs/header.html new file mode 100644 index 0000000..646b8ff --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/header.html @@ -0,0 +1,13 @@ +
+ + +

{{ partial "docs/title" . }}

+ + +
diff --git a/themes/hugo-book/layouts/partials/docs/html-head-favicon.html b/themes/hugo-book/layouts/partials/docs/html-head-favicon.html new file mode 100644 index 0000000..8278050 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/html-head-favicon.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/hugo-book/layouts/partials/docs/html-head-title.html b/themes/hugo-book/layouts/partials/docs/html-head-title.html new file mode 100644 index 0000000..49a109d --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/html-head-title.html @@ -0,0 +1 @@ +{{ partial "docs/title" . }} | {{ .Site.Title -}} diff --git a/themes/hugo-book/layouts/partials/docs/html-head.html b/themes/hugo-book/layouts/partials/docs/html-head.html new file mode 100644 index 0000000..6a6d0ec --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/html-head.html @@ -0,0 +1,56 @@ + + + + + + + +{{- with .Page.Params.BookHref -}} + +{{- end -}} + +{{- template "_internal/opengraph.html" . -}} + +{{ partial "docs/html-head-title" . }} +{{ partial "docs/html-head-favicon" . }} + +{{- $manifest := resources.Get "manifest.json" | resources.ExecuteAsTemplate "manifest.json" . }} + + + +{{- range .Translations }} + +{{- end -}} + + +{{- $styles := resources.Get "book.scss" | resources.ExecuteAsTemplate "book.scss" . | css.Sass | resources.Minify | resources.Fingerprint }} + +{{- if default true .Site.Params.BookSearch -}} + {{- $searchJSFile := printf "%s.search.js" .Language.Lang }} + {{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify | resources.Fingerprint }} + + +{{ end -}} + +{{- if .Site.Params.BookServiceWorker -}} + {{- $swJS := resources.Get "sw-register.js" | resources.ExecuteAsTemplate "sw.js" . | resources.Minify | resources.Fingerprint }} + +{{ end -}} + +{{- template "_internal/google_analytics.html" . -}} + + +{{- with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} +{{ end -}} + +{{ "" | safeHTML }} + +{{- define "integrity" -}} + {{- if (urls.Parse .Permalink).Host -}} + integrity="{{ .Data.Integrity }}" crossorigin="anonymous" + {{- end -}} +{{- end -}} diff --git a/themes/hugo-book/layouts/partials/docs/inject/body.html b/themes/hugo-book/layouts/partials/docs/inject/body.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-book/layouts/partials/docs/inject/content-after.html b/themes/hugo-book/layouts/partials/docs/inject/content-after.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-book/layouts/partials/docs/inject/content-before.html b/themes/hugo-book/layouts/partials/docs/inject/content-before.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-book/layouts/partials/docs/inject/footer.html b/themes/hugo-book/layouts/partials/docs/inject/footer.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-book/layouts/partials/docs/inject/head.html b/themes/hugo-book/layouts/partials/docs/inject/head.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-book/layouts/partials/docs/inject/menu-after.html b/themes/hugo-book/layouts/partials/docs/inject/menu-after.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-book/layouts/partials/docs/inject/menu-before.html b/themes/hugo-book/layouts/partials/docs/inject/menu-before.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-book/layouts/partials/docs/inject/toc-after.html b/themes/hugo-book/layouts/partials/docs/inject/toc-after.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-book/layouts/partials/docs/inject/toc-before.html b/themes/hugo-book/layouts/partials/docs/inject/toc-before.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-book/layouts/partials/docs/languages.html b/themes/hugo-book/layouts/partials/docs/languages.html new file mode 100644 index 0000000..51aabdd --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/languages.html @@ -0,0 +1,33 @@ + +{{ $bookTranslatedOnly := default false .Site.Params.BookTranslatedOnly }} +{{ $translations := dict }} +{{ if (eq $bookTranslatedOnly false ) }} + {{ range .Site.Home.Translations }} + {{ $translations = merge $translations (dict .Language.Lang .) }} + {{ end }} +{{ end }} +{{ range .Translations }} + {{ $translations = merge $translations (dict .Language.Lang .) }} +{{ end }} + + diff --git a/themes/hugo-book/layouts/partials/docs/links/commit.html b/themes/hugo-book/layouts/partials/docs/links/commit.html new file mode 100644 index 0000000..8ab9334 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/links/commit.html @@ -0,0 +1,2 @@ +{{- $commitPath := default "commit" .Site.Params.BookCommitPath -}} +{{- .Site.Params.BookRepo }}/{{ $commitPath }}/{{ .GitInfo.Hash -}} \ No newline at end of file diff --git a/themes/hugo-book/layouts/partials/docs/links/edit.html b/themes/hugo-book/layouts/partials/docs/links/edit.html new file mode 100644 index 0000000..920affa --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/links/edit.html @@ -0,0 +1,2 @@ +{{- $bookFilePath := (strings.TrimPrefix hugo.WorkingDir .Page.File.Filename | path.Join) -}} +{{- .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}{{ ($bookFilePath) -}} \ No newline at end of file diff --git a/themes/hugo-book/layouts/partials/docs/menu-filetree.html b/themes/hugo-book/layouts/partials/docs/menu-filetree.html new file mode 100644 index 0000000..1494588 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/menu-filetree.html @@ -0,0 +1,49 @@ +{{ $bookSection := default "docs" .Site.Params.BookSection }} +{{ if eq $bookSection "*" }} + {{ $bookSection = "/" }}{{/* Backward compatibility */}} +{{ end }} + +{{ with .Site.GetPage $bookSection }} + {{ template "book-section-children" (dict "Section" . "CurrentPage" $) }} +{{ end }} + +{{ define "book-section-children" }}{{/* (dict "Section" .Section "CurrentPage" .CurrentPage) */}} + +{{ end }} + +{{ define "book-page-link" }}{{/* (dict "Page" .Page "CurrentPage" .CurrentPage) */}} + {{ $current := eq .CurrentPage .Page }} + {{ $ancestor := .Page.IsAncestor .CurrentPage }} + + {{ if .Page.Params.BookCollapseSection }} + + + {{ else if .Page.Params.BookHref }} + + {{- partial "docs/title" .Page -}} + + {{ else if .Page.Content }} + + {{- partial "docs/title" .Page -}} + + {{ else }} + {{- partial "docs/title" .Page -}} + {{ end }} +{{ end }} diff --git a/themes/hugo-book/layouts/partials/docs/menu-hugo.html b/themes/hugo-book/layouts/partials/docs/menu-hugo.html new file mode 100644 index 0000000..5f01be0 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/menu-hugo.html @@ -0,0 +1,28 @@ + +{{ if . }} + {{ template "book-menu-hugo" . }} +{{ end }} + +{{ define "book-menu-hugo" }} + +{{ end }} diff --git a/themes/hugo-book/layouts/partials/docs/menu.html b/themes/hugo-book/layouts/partials/docs/menu.html new file mode 100644 index 0000000..dbb2e49 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/menu.html @@ -0,0 +1,21 @@ + + + +{{ $script := resources.Get "menu-reset.js" | resources.Minify }} +{{ with $script.Content }} + +{{ end }} diff --git a/themes/hugo-book/layouts/partials/docs/post-meta.html b/themes/hugo-book/layouts/partials/docs/post-meta.html new file mode 100644 index 0000000..457e2c0 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/post-meta.html @@ -0,0 +1,16 @@ +{{ with .Date }} +
+ + {{ partial "docs/date" (dict "Date" . "Format" $.Site.Params.BookDateFormat) }} +
+{{ end }} + +{{ range $taxonomy, $_ := .Site.Taxonomies }} + {{ with $terms := $.GetTerms $taxonomy }} +
+ {{ range $n, $term := $terms }}{{ if $n }}, {{ end }} + {{ $term.Title }} + {{- end }} +
+ {{ end }} +{{ end }} diff --git a/themes/hugo-book/layouts/partials/docs/search.html b/themes/hugo-book/layouts/partials/docs/search.html new file mode 100644 index 0000000..937f595 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/search.html @@ -0,0 +1,8 @@ +{{ if default true .Site.Params.BookSearch }} + + +{{ end }} diff --git a/themes/hugo-book/layouts/partials/docs/taxonomy.html b/themes/hugo-book/layouts/partials/docs/taxonomy.html new file mode 100644 index 0000000..63ef315 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/taxonomy.html @@ -0,0 +1,19 @@ + diff --git a/themes/hugo-book/layouts/partials/docs/title.html b/themes/hugo-book/layouts/partials/docs/title.html new file mode 100644 index 0000000..83df5b6 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/title.html @@ -0,0 +1,17 @@ + +{{ $title := "" }} + +{{ if .LinkTitle }} + {{ $title = .LinkTitle }} +{{ else if .Title }} + {{ $title = .Title }} +{{ else if and .IsSection .File }} + {{ $title = path.Base .File.Dir | humanize | title }} +{{ else if and .IsPage .File }} + {{ $title = .File.BaseFileName | humanize | title }} +{{ end }} + +{{ return $title }} diff --git a/themes/hugo-book/layouts/partials/docs/toc.html b/themes/hugo-book/layouts/partials/docs/toc.html new file mode 100644 index 0000000..64697a4 --- /dev/null +++ b/themes/hugo-book/layouts/partials/docs/toc.html @@ -0,0 +1,3 @@ +{{ partial "docs/inject/toc-before" . }} +{{ .TableOfContents }} +{{ partial "docs/inject/toc-after" . }} diff --git a/themes/hugo-book/layouts/posts/list.html b/themes/hugo-book/layouts/posts/list.html new file mode 100644 index 0000000..aff32f5 --- /dev/null +++ b/themes/hugo-book/layouts/posts/list.html @@ -0,0 +1,22 @@ +{{ define "main" }} + {{ range sort .Paginator.Pages }} +
+

+ {{ partial "docs/title.html" . }} +

+ {{ partial "docs/post-meta" . }} +
+ {{- .Summary -}} + {{ if .Truncated }} + ... + {{ end }} +
+
+ {{ end }} + + {{ template "_internal/pagination.html" . }} +{{ end }} + +{{ define "toc" }} + {{ partial "docs/taxonomy" . }} +{{ end }} diff --git a/themes/hugo-book/layouts/posts/single.html b/themes/hugo-book/layouts/posts/single.html new file mode 100644 index 0000000..cebdd11 --- /dev/null +++ b/themes/hugo-book/layouts/posts/single.html @@ -0,0 +1,15 @@ +{{ define "main" }} +
+

+ {{ partial "docs/title.html" . }} +

+ {{ partial "docs/post-meta" . }} +
+ {{- .Content -}} +
+
+{{ end }} + +{{ define "toc" }} + {{ partial "docs/toc" . }} +{{ end }} 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 }} +
diff --git a/themes/hugo-book/layouts/taxonomy/list.html b/themes/hugo-book/layouts/taxonomy/list.html new file mode 100644 index 0000000..1d3e763 --- /dev/null +++ b/themes/hugo-book/layouts/taxonomy/list.html @@ -0,0 +1,13 @@ +{{ define "main" }} +
+

{{ .Title | title }}

+ {{ $taxonomies := index .Site.Taxonomies .Page.Type }} + {{ range $taxonomies }} +
{{ .Page.Title }} {{ .Count }}
+ {{ end }} +
+{{ end }} + +{{ define "toc" }} + {{ partial "docs/taxonomy" . }} +{{ end }} diff --git a/themes/hugo-book/layouts/taxonomy/taxonomy.html b/themes/hugo-book/layouts/taxonomy/taxonomy.html new file mode 100644 index 0000000..badf0f6 --- /dev/null +++ b/themes/hugo-book/layouts/taxonomy/taxonomy.html @@ -0,0 +1,22 @@ +{{ define "main" }} + {{ range sort .Paginator.Pages }} +
+

+ {{ partial "docs/title.html" . }} +

+ {{ partial "docs/post-meta" . }} +

+ {{- .Summary -}} + {{ if .Truncated }} + ... + {{ end }} +

+
+ {{ end }} + + {{ template "_internal/pagination.html" . }} +{{ end }} + +{{ define "toc" }} + {{ partial "docs/taxonomy" . }} +{{ end }} -- cgit v1.2.3