From 9b5f3fad7068298265dbbc8a65077f7917a090a5 Mon Sep 17 00:00:00 2001 From: aethrvmn Date: Sun, 21 Sep 2025 00:27:35 +0200 Subject: updated hugo-book theme --- .../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 - .../layouts/_markup/render-blockquote.html | 9 +++ .../layouts/_markup/render-codeblock-katex.html | 13 ++++ .../layouts/_markup/render-codeblock-mermaid.html | 12 +++ .../layouts/_markup/render-codeblock.html | 10 +++ .../hugo-book/layouts/_markup/render-heading.html | 6 ++ themes/hugo-book/layouts/_markup/render-image.html | 6 ++ themes/hugo-book/layouts/_markup/render-link.html | 6 ++ 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 ++ .../hugo-book/layouts/_partials/docs/footer.html | 29 +++++++ .../hugo-book/layouts/_partials/docs/header.html | 13 ++++ .../layouts/_partials/docs/html-head-favicon.html | 1 + .../layouts/_partials/docs/html-head-title.html | 1 + .../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 .../layouts/_partials/docs/languages.html | 33 ++++++++ .../layouts/_partials/docs/links/commit.html | 5 ++ .../layouts/_partials/docs/links/edit.html | 5 ++ .../_partials/docs/links/portable-image.html | 26 +++++++ .../_partials/docs/links/portable-link.html | 29 +++++++ .../layouts/_partials/docs/menu-filetree.html | 49 ++++++++++++ .../layouts/_partials/docs/menu-hugo.html | 29 +++++++ themes/hugo-book/layouts/_partials/docs/menu.html | 21 +++++ .../layouts/_partials/docs/pagination.html | 28 +++++++ .../layouts/_partials/docs/post-meta.html | 16 ++++ .../layouts/_partials/docs/post-prev-next.html | 18 +++++ .../layouts/_partials/docs/prev-next-cache.html | 14 ++++ .../layouts/_partials/docs/prev-next.html | 31 ++++++++ .../hugo-book/layouts/_partials/docs/search.html | 8 ++ .../hugo-book/layouts/_partials/docs/taxonomy.html | 19 +++++ .../layouts/_partials/docs/text/template.html | 9 +++ themes/hugo-book/layouts/_partials/docs/title.html | 17 ++++ .../hugo-book/layouts/_partials/docs/toc-show.html | 4 + themes/hugo-book/layouts/_partials/docs/toc.html | 3 + themes/hugo-book/layouts/_shortcodes/badge.html | 5 ++ themes/hugo-book/layouts/_shortcodes/button.html | 5 ++ themes/hugo-book/layouts/_shortcodes/card.html | 22 ++++++ themes/hugo-book/layouts/_shortcodes/columns.html | 21 +++++ 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/image.html | 12 +++ themes/hugo-book/layouts/_shortcodes/katex.html | 19 +++++ themes/hugo-book/layouts/_shortcodes/mermaid.html | 12 +++ themes/hugo-book/layouts/_shortcodes/section.html | 13 ++++ themes/hugo-book/layouts/_shortcodes/steps.html | 3 + themes/hugo-book/layouts/_shortcodes/tab.html | 9 +++ themes/hugo-book/layouts/_shortcodes/tabs.html | 3 + themes/hugo-book/layouts/baseof.html | 90 ++++++++++++++++++++++ themes/hugo-book/layouts/landing.html | 15 ++++ themes/hugo-book/layouts/list.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 | 35 ++++++--- themes/hugo-book/layouts/posts/single.html | 8 +- 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/single.html | 1 + themes/hugo-book/layouts/taxonomy/list.html | 13 ---- themes/hugo-book/layouts/taxonomy/taxonomy.html | 22 ------ themes/hugo-book/layouts/term.html | 27 +++++++ 112 files changed, 845 insertions(+), 579 deletions(-) delete mode 100644 themes/hugo-book/layouts/_default/_markup/render-heading.html delete mode 100644 themes/hugo-book/layouts/_default/_markup/render-image.html delete mode 100644 themes/hugo-book/layouts/_default/_markup/render-link.html delete mode 100644 themes/hugo-book/layouts/_default/baseof.html delete mode 100644 themes/hugo-book/layouts/_default/list.html delete mode 100644 themes/hugo-book/layouts/_default/single.html create mode 100644 themes/hugo-book/layouts/_markup/render-blockquote.html create mode 100644 themes/hugo-book/layouts/_markup/render-codeblock-katex.html create mode 100644 themes/hugo-book/layouts/_markup/render-codeblock-mermaid.html create mode 100644 themes/hugo-book/layouts/_markup/render-codeblock.html create mode 100644 themes/hugo-book/layouts/_markup/render-heading.html create mode 100644 themes/hugo-book/layouts/_markup/render-image.html create mode 100644 themes/hugo-book/layouts/_markup/render-link.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/links/portable-image.html create mode 100644 themes/hugo-book/layouts/_partials/docs/links/portable-link.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/pagination.html create mode 100644 themes/hugo-book/layouts/_partials/docs/post-meta.html create mode 100644 themes/hugo-book/layouts/_partials/docs/post-prev-next.html create mode 100644 themes/hugo-book/layouts/_partials/docs/prev-next-cache.html create mode 100644 themes/hugo-book/layouts/_partials/docs/prev-next.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/text/template.html create mode 100644 themes/hugo-book/layouts/_partials/docs/title.html create mode 100644 themes/hugo-book/layouts/_partials/docs/toc-show.html create mode 100644 themes/hugo-book/layouts/_partials/docs/toc.html create mode 100644 themes/hugo-book/layouts/_shortcodes/badge.html create mode 100644 themes/hugo-book/layouts/_shortcodes/button.html create mode 100644 themes/hugo-book/layouts/_shortcodes/card.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/image.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/steps.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/baseof.html create mode 100644 themes/hugo-book/layouts/landing.html create mode 100644 themes/hugo-book/layouts/list.html delete mode 100644 themes/hugo-book/layouts/partials/docs/brand.html delete mode 100644 themes/hugo-book/layouts/partials/docs/comments.html delete mode 100644 themes/hugo-book/layouts/partials/docs/date.html delete mode 100644 themes/hugo-book/layouts/partials/docs/footer.html delete mode 100644 themes/hugo-book/layouts/partials/docs/header.html delete mode 100644 themes/hugo-book/layouts/partials/docs/html-head-favicon.html delete mode 100644 themes/hugo-book/layouts/partials/docs/html-head-title.html delete mode 100644 themes/hugo-book/layouts/partials/docs/html-head.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/body.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/content-after.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/content-before.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/footer.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/head.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/menu-after.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/menu-before.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/toc-after.html delete mode 100644 themes/hugo-book/layouts/partials/docs/inject/toc-before.html delete mode 100644 themes/hugo-book/layouts/partials/docs/languages.html delete mode 100644 themes/hugo-book/layouts/partials/docs/links/commit.html delete mode 100644 themes/hugo-book/layouts/partials/docs/links/edit.html delete mode 100644 themes/hugo-book/layouts/partials/docs/menu-filetree.html delete mode 100644 themes/hugo-book/layouts/partials/docs/menu-hugo.html delete mode 100644 themes/hugo-book/layouts/partials/docs/menu.html delete mode 100644 themes/hugo-book/layouts/partials/docs/post-meta.html delete mode 100644 themes/hugo-book/layouts/partials/docs/search.html delete mode 100644 themes/hugo-book/layouts/partials/docs/taxonomy.html delete mode 100644 themes/hugo-book/layouts/partials/docs/title.html delete mode 100644 themes/hugo-book/layouts/partials/docs/toc.html delete mode 100644 themes/hugo-book/layouts/shortcodes/button.html delete mode 100644 themes/hugo-book/layouts/shortcodes/columns.html delete mode 100644 themes/hugo-book/layouts/shortcodes/details.html delete mode 100644 themes/hugo-book/layouts/shortcodes/hint.html delete mode 100644 themes/hugo-book/layouts/shortcodes/html.html delete mode 100644 themes/hugo-book/layouts/shortcodes/i18n.html delete mode 100644 themes/hugo-book/layouts/shortcodes/katex.html delete mode 100644 themes/hugo-book/layouts/shortcodes/mermaid.html delete mode 100644 themes/hugo-book/layouts/shortcodes/section.html delete mode 100644 themes/hugo-book/layouts/shortcodes/tab.html delete mode 100644 themes/hugo-book/layouts/shortcodes/tabs.html create mode 100644 themes/hugo-book/layouts/single.html delete mode 100644 themes/hugo-book/layouts/taxonomy/list.html delete mode 100644 themes/hugo-book/layouts/taxonomy/taxonomy.html create mode 100644 themes/hugo-book/layouts/term.html (limited to 'themes/hugo-book/layouts') diff --git a/themes/hugo-book/layouts/_default/_markup/render-heading.html b/themes/hugo-book/layouts/_default/_markup/render-heading.html deleted file mode 100644 index 5439d20..0000000 --- a/themes/hugo-book/layouts/_default/_markup/render-heading.html +++ /dev/null @@ -1,4 +0,0 @@ - - {{ .Text | safeHTML }} - # - diff --git a/themes/hugo-book/layouts/_default/_markup/render-image.html b/themes/hugo-book/layouts/_default/_markup/render-image.html deleted file mode 100644 index 148cbaf..0000000 --- a/themes/hugo-book/layouts/_default/_markup/render-image.html +++ /dev/null @@ -1,19 +0,0 @@ -{{- 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 deleted file mode 100644 index 288d81c..0000000 --- a/themes/hugo-book/layouts/_default/_markup/render-link.html +++ /dev/null @@ -1,29 +0,0 @@ -{{- 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 deleted file mode 100644 index a6c4c07..0000000 --- a/themes/hugo-book/layouts/_default/baseof.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - {{ 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 deleted file mode 100644 index 0dc8b68..0000000 --- a/themes/hugo-book/layouts/_default/list.html +++ /dev/null @@ -1 +0,0 @@ -{{ define "dummy" }}{{ end }} diff --git a/themes/hugo-book/layouts/_default/single.html b/themes/hugo-book/layouts/_default/single.html deleted file mode 100644 index 0dc8b68..0000000 --- a/themes/hugo-book/layouts/_default/single.html +++ /dev/null @@ -1 +0,0 @@ -{{ define "dummy" }}{{ end }} diff --git a/themes/hugo-book/layouts/_markup/render-blockquote.html b/themes/hugo-book/layouts/_markup/render-blockquote.html new file mode 100644 index 0000000..88809a1 --- /dev/null +++ b/themes/hugo-book/layouts/_markup/render-blockquote.html @@ -0,0 +1,9 @@ +{{- $attributes := .Attributes }} +{{- $class := printf "book-hint %s" ($.AlertType | lower) }} +{{- if isset $attributes "class" }} + {{ $class = printf "%s %s" $class (index $attributes "class") }} +{{ end -}} +{{- $attributes = merge $attributes (dict "class" $class) }} +
+ {{ .Text }} +
\ No newline at end of file diff --git a/themes/hugo-book/layouts/_markup/render-codeblock-katex.html b/themes/hugo-book/layouts/_markup/render-codeblock-katex.html new file mode 100644 index 0000000..94bcb55 --- /dev/null +++ b/themes/hugo-book/layouts/_markup/render-codeblock-katex.html @@ -0,0 +1,13 @@ +{{- if not (.Page.Store.Get "katex") -}} + + + +{{ with resources.Get "katex.json" }} + +{{ end }} +{{- .Page.Store.Set "katex" true -}} +{{- end -}} + +{{- with .Inner }} +\[ {{ .| htmlEscape | safeHTML }} \] +{{ end -}} diff --git a/themes/hugo-book/layouts/_markup/render-codeblock-mermaid.html b/themes/hugo-book/layouts/_markup/render-codeblock-mermaid.html new file mode 100644 index 0000000..097857a --- /dev/null +++ b/themes/hugo-book/layouts/_markup/render-codeblock-mermaid.html @@ -0,0 +1,12 @@ +{{ if not (.Page.Store.Get "mermaid") }} + + +{{ with resources.Get "mermaid.json" }} + +{{ end }} +{{ .Page.Store.Set "mermaid" true }} +{{ end }} + +
+  {{- .Inner -}}
+
diff --git a/themes/hugo-book/layouts/_markup/render-codeblock.html b/themes/hugo-book/layouts/_markup/render-codeblock.html new file mode 100644 index 0000000..a79563f --- /dev/null +++ b/themes/hugo-book/layouts/_markup/render-codeblock.html @@ -0,0 +1,10 @@ +{{- with (index .Attributes "filename") -}} + {{- $href := index $.Attributes "href" -}} + {{- if $href -}} + {{- $href = partial "docs/links/portable-link" (dict "Page" $.PageInner "Destination" $href) -}} + {{- end -}} +
+ {{ . }} +
+{{- end -}} +{{- (transform.HighlightCodeBlock . .Options).Wrapped -}} diff --git a/themes/hugo-book/layouts/_markup/render-heading.html b/themes/hugo-book/layouts/_markup/render-heading.html new file mode 100644 index 0000000..d2b3c28 --- /dev/null +++ b/themes/hugo-book/layouts/_markup/render-heading.html @@ -0,0 +1,6 @@ + + {{ .Text }} + {{ if default true .Page.Params.bookHeadingAnchor }} + # + {{ end }} + diff --git a/themes/hugo-book/layouts/_markup/render-image.html b/themes/hugo-book/layouts/_markup/render-image.html new file mode 100644 index 0000000..2453b46 --- /dev/null +++ b/themes/hugo-book/layouts/_markup/render-image.html @@ -0,0 +1,6 @@ +{{- $destination := .Destination -}} +{{- if .Page.Site.Params.BookPortableLinks -}} + {{- $destination = partial "docs/links/portable-image" . -}} +{{- end -}} +{{ .Text }} +{{- /**/ -}} \ No newline at end of file diff --git a/themes/hugo-book/layouts/_markup/render-link.html b/themes/hugo-book/layouts/_markup/render-link.html new file mode 100644 index 0000000..8aefa3f --- /dev/null +++ b/themes/hugo-book/layouts/_markup/render-link.html @@ -0,0 +1,6 @@ +{{- $destination := .Destination -}} +{{- if .Page.Site.Params.BookPortableLinks -}} + {{- $destination = partial "docs/links/portable-link" . -}} +{{- end -}} +{{ .Text | safeHTML }} +{{- /**/ -}} \ No newline at end of file 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..7824ef1 --- /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..01d8322 --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/footer.html @@ -0,0 +1,29 @@ +
+ +{{ if and .GitInfo .Site.Params.BookLastChangeLink }} +
+ {{- $date := partial "docs/date" (dict "Date" .Lastmod "Format" .Site.Params.BookDateFormat) -}} + + + {{ $date }} + +
+{{ end }} + +{{ if and .File .Site.Params.BookEditLink }} +
+ + + {{ i18n "Edit this page" }} + +
+{{ end }} + +
+ +{{ partial "docs/prev-next" . }} + +{{ $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..ad5582e --- /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..70ddc0a --- /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..a20f07c --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/links/commit.html @@ -0,0 +1,5 @@ +{{- return (partial "docs/text/template" (dict "Template" .Site.Params.BookLastChangeLink "Context" (dict + "Site" .Site + "Page" .Page + "GitInfo" .GitInfo +)) | urls.JoinPath) -}} \ 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..3243412 --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/links/edit.html @@ -0,0 +1,5 @@ +{{- return (partial "docs/text/template" (dict "Template" .Site.Params.BookEditLink "Context" (dict + "Site" .Site + "Page" .Page + "Path" (strings.TrimPrefix hugo.WorkingDir .Page.File.Filename) +)) | urls.JoinPath) -}} \ No newline at end of file diff --git a/themes/hugo-book/layouts/_partials/docs/links/portable-image.html b/themes/hugo-book/layouts/_partials/docs/links/portable-image.html new file mode 100644 index 0000000..4b9bc44 --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/links/portable-image.html @@ -0,0 +1,26 @@ +{{- $destination := .Destination -}} +{{- $url := urls.Parse .Destination -}} + +{{- $isRemote := gt (len $url.Host) 0 -}} +{{- $isFragment := strings.HasPrefix .Destination "#" -}} + +{{- if and (not $isRemote) (not $isFragment) -}} + {{- $path := strings.TrimPrefix "./" $url.Path -}} + {{- $path = strings.TrimPrefix "/assets/" $path -}} + + {{- with (.Page.Resources.Get $path) -}} + {{- $destination = .RelPermalink -}} + {{- else with (resources.Get $path) -}} + {{- $destination = .RelPermalink -}} + {{- else -}} + {{- warnf "Image reference '%s' not found in '%s'" .Destination .Page.Permalink -}} + {{- end -}} + + {{- with $url.RawQuery -}} + {{- $destination = print $destination "?" . -}} + {{- end -}} + {{- with $url.Fragment -}} + {{- $destination = print $destination "#" . -}} + {{- end -}} +{{- end -}} +{{- return $destination -}} diff --git a/themes/hugo-book/layouts/_partials/docs/links/portable-link.html b/themes/hugo-book/layouts/_partials/docs/links/portable-link.html new file mode 100644 index 0000000..4c5c0c0 --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/links/portable-link.html @@ -0,0 +1,29 @@ +{{- $destination := .Destination -}} +{{- $url := urls.Parse .Destination -}} + +{{- $isRemote := gt (len $url.Host) 0 -}} +{{- $isFragment := strings.HasPrefix .Destination "#" -}} + +{{- if and (not $isRemote) (not $isFragment) -}} + {{- $path := strings.TrimPrefix "./" $url.Path -}} + {{- $path = strings.TrimSuffix ".md" $path -}} + {{- $path = strings.TrimSuffix "/_index" $path -}} + + {{- with (.Page.GetPage $path) -}} + {{- $destination = .RelPermalink -}} + {{- else with (.Page.Resources.Get $path) -}} + {{- $destination = .RelPermalink -}} + {{- else with (resources.Get $path) -}} + {{- $destination = .RelPermalink -}} + {{- else -}} + {{- warnf "Reference '%s' not found in '%s'" .Destination .Page.Permalink -}} + {{- end -}} + + {{- with $url.RawQuery -}} + {{- $destination = print $destination "?" . -}} + {{- end -}} + {{- with $url.Fragment -}} + {{- $destination = print $destination "#" . -}} + {{- end -}} +{{- end -}} +{{- return $destination -}} \ 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..5105aa8 --- /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..871eea7 --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/menu-hugo.html @@ -0,0 +1,29 @@ + +{{ 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/pagination.html b/themes/hugo-book/layouts/_partials/docs/pagination.html new file mode 100644 index 0000000..9e0d154 --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/pagination.html @@ -0,0 +1,28 @@ +{{- if .Paginator -}} +
+ + {{- with .Paginator.Prev }} + + Previous + + {{ end }} + + {{ if gt (len .Paginator.Pagers) 1 }} + + {{- $currentPageNumber := .Paginator.PageNumber -}} + {{- range $pageIndex := (slice -2 -1 0 1 2) -}} + {{- with index $.Paginator.Pagers (add $currentPageNumber $pageIndex -1) -}} + {{ .PageNumber }} + {{- end -}} + {{- end -}} + + {{ end }} + + {{- with .Paginator.Next }} + + Next + + {{ end }} + +
+{{- 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/post-prev-next.html b/themes/hugo-book/layouts/_partials/docs/post-prev-next.html new file mode 100644 index 0000000..d7192c0 --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/post-prev-next.html @@ -0,0 +1,18 @@ +
+ + {{ with .NextInSection }} + + Previous + {{ partial "docs/title" . }} + + {{ end }} + + + {{ with .PrevInSection }} + + {{ partial "docs/title" . }} + Next + + {{ end }} + +
\ No newline at end of file diff --git a/themes/hugo-book/layouts/_partials/docs/prev-next-cache.html b/themes/hugo-book/layouts/_partials/docs/prev-next-cache.html new file mode 100644 index 0000000..1561c06 --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/prev-next-cache.html @@ -0,0 +1,14 @@ +{{ $scratch := newScratch }} +{{ template "recurse" (dict "Scratch" $scratch "Sections" .) }} +{{ define "recurse" }} + {{ range .Sections }} + {{ if and .Content (not .Params.BookHidden) }} + {{ $.Scratch.Add "BookPages" (slice .) }} + {{ end }} + {{ if .IsSection }} + {{ template "recurse" (dict "Scratch" $.Scratch "Sections" .Pages) }} + {{ end }} + {{ end }} +{{ end }} + +{{ return $scratch.Get "BookPages" }} diff --git a/themes/hugo-book/layouts/_partials/docs/prev-next.html b/themes/hugo-book/layouts/_partials/docs/prev-next.html new file mode 100644 index 0000000..d93e5ed --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/prev-next.html @@ -0,0 +1,31 @@ +{{ $bookSection := default "docs" .Site.Params.BookSection }} +{{ if eq $bookSection "*" }} + {{ $bookSection = "/" }}{{/* Backward compatibility */}} +{{ end }} + +{{ with .Site.GetPage $bookSection }} + {{ $pages := partialCached "docs/prev-next-cache" .Pages }} + {{ $prev := $pages.Next $ }} + {{ $next := $pages.Prev $ }} + + {{- if or $prev $next }} +
+ + {{ with $prev }} + + Previous + {{ partial "docs/title" . }} + + {{ end }} + + + {{ with $next }} + + {{ partial "docs/title" . }} + Next + + {{ 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..90366ae --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/taxonomy.html @@ -0,0 +1,19 @@ + diff --git a/themes/hugo-book/layouts/_partials/docs/text/template.html b/themes/hugo-book/layouts/_partials/docs/text/template.html new file mode 100644 index 0000000..53e535d --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/text/template.html @@ -0,0 +1,9 @@ + + +{{- $checksum := . | encoding.Jsonify | crypto.SHA1 | printf "book-%s" -}} +{{- $template := resources.FromString $checksum .Template -}} +{{- $template = $template | resources.ExecuteAsTemplate $checksum .Context -}} +{{- return $template.Content -}} \ No newline at end of file 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-show.html b/themes/hugo-book/layouts/_partials/docs/toc-show.html new file mode 100644 index 0000000..5115c84 --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/toc-show.html @@ -0,0 +1,4 @@ +{{ return default + (not (eq .TableOfContents "")) + (default .Site.Params.BookToC .Params.BookToC) +}} \ No newline at end of file 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/_shortcodes/badge.html b/themes/hugo-book/layouts/_shortcodes/badge.html new file mode 100644 index 0000000..0bbfcb1 --- /dev/null +++ b/themes/hugo-book/layouts/_shortcodes/badge.html @@ -0,0 +1,5 @@ +{{- $style := default "default" (.Get "style") -}} + + {{- with .Get "title" }}{{ . | plainify }}{{ end -}} + {{- with .Get "value" }}{{ . | plainify }}{{ end -}} + \ No newline at end of file diff --git a/themes/hugo-book/layouts/_shortcodes/button.html b/themes/hugo-book/layouts/_shortcodes/button.html new file mode 100644 index 0000000..cd7e016 --- /dev/null +++ b/themes/hugo-book/layouts/_shortcodes/button.html @@ -0,0 +1,5 @@ +{{ $href := partial "docs/links/portable-link" (dict "Page" .Page "Destination" (.Get "href")) -}} +{{ $isRemote := (urls.Parse $href).Scheme}} + + {{- .InnerDeindent -}} + diff --git a/themes/hugo-book/layouts/_shortcodes/card.html b/themes/hugo-book/layouts/_shortcodes/card.html new file mode 100644 index 0000000..086fb97 --- /dev/null +++ b/themes/hugo-book/layouts/_shortcodes/card.html @@ -0,0 +1,22 @@ +{{- /* remove whitespace */ -}} +{{- with .Get "href" -}} +{{- $destination := partial "docs/links/portable-link" (dict "Page" $.Page "Destination" .) -}} + +{{- template "book-card-content" $ -}} + +{{- else -}} +
+{{- template "book-card-content" $ -}} +
+{{- end -}} + +{{- define "book-card-content" -}} +{{- with .Get "image" -}} + {{- $destination := partial "docs/links/portable-image" (dict "Page" $.Page "Destination" .) -}} + +{{- end }} +
+ {{ with .InnerDeindent }}{{ . }}{{ end }} +
+{{- end -}} +{{- /* remove whitespace */ -}} diff --git a/themes/hugo-book/layouts/_shortcodes/columns.html b/themes/hugo-book/layouts/_shortcodes/columns.html new file mode 100644 index 0000000..1d6abdd --- /dev/null +++ b/themes/hugo-book/layouts/_shortcodes/columns.html @@ -0,0 +1,21 @@ +{{- $ratio := (split (.Get "ratio") ":") -}} +{{- if strings.Contains .InnerDeindent "<--->" -}} +{{ warnf "Columns shortcode seprator '<--->' is deprecated, use markdown list instead." -}} +
+{{ range $index, $content := split .InnerDeindent "<--->" }} + {{- $grow := default 1 (index $ratio $index) -}} +
+ {{ $content | safeHTML }} +
+{{ end }} +
+{{ else }} +{{- if .Get "ratio" }}{{ end -}} +
+{{ .InnerDeindent | 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..a71f1fd --- /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/image.html b/themes/hugo-book/layouts/_shortcodes/image.html new file mode 100644 index 0000000..e1b9c46 --- /dev/null +++ b/themes/hugo-book/layouts/_shortcodes/image.html @@ -0,0 +1,12 @@ +{{- /* remove whitespaces */ -}} +{{- $destination := partial "docs/links/portable-image" (dict "Page" .Page "Destination" (.Get "src")) -}} + +{{- /* remove whitespaces */ -}} \ 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..b3f38ac --- /dev/null +++ b/themes/hugo-book/layouts/_shortcodes/katex.html @@ -0,0 +1,19 @@ +{{- if not (.Page.Store.Get "katex") -}} + + + +{{ with resources.Get "katex.json" }} + +{{ end }} +{{- .Page.Store.Set "katex" true -}} +{{- end -}} + +{{ if .Inner }} + + {{- if .Get "display" }} + \[ {{ .Inner }} \] + {{ else }} + \( {{ .Inner }} \) + {{ end -}} + +{{ 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..078d7d3 --- /dev/null +++ b/themes/hugo-book/layouts/_shortcodes/mermaid.html @@ -0,0 +1,12 @@ +{{ if not (.Page.Store.Get "mermaid") }} + + +{{ with resources.Get "mermaid.json" }} + +{{ end }} +{{ .Page.Store.Set "mermaid" true }} +{{ end }} + +
+  {{- .Inner | htmlEscape | safeHTML  -}}
+
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/steps.html b/themes/hugo-book/layouts/_shortcodes/steps.html new file mode 100644 index 0000000..46cfaa1 --- /dev/null +++ b/themes/hugo-book/layouts/_shortcodes/steps.html @@ -0,0 +1,3 @@ +
+ {{ .Inner }} +
\ No newline at end of file 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/baseof.html b/themes/hugo-book/layouts/baseof.html new file mode 100644 index 0000000..2e6b0a9 --- /dev/null +++ b/themes/hugo-book/layouts/baseof.html @@ -0,0 +1,90 @@ + + + + {{ partial "docs/html-head" . }} + {{ partial "docs/inject/head" . }} + + + + +
+ {{ template "menu-container" . }} + +
+
+ {{ template "header" . }} +
+ + {{ partial "docs/inject/content-before" . }} + {{ template "main" . }} + {{ partial "docs/inject/content-after" . }} + +
+ {{ template "footer" . }} + {{ partial "docs/inject/footer" . }} +
+ + {{ template "comments" . }} + +
+ + {{ template "toc-container" . }} +
+ + {{ partial "docs/inject/body" . }} + + + +{{ define "menu-container" }} + +{{ end }} + +{{ 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-container" }} +{{ if partial "docs/toc-show" . }} + +{{ end }} +{{ end }} + +{{ define "toc" }} + {{ partial "docs/toc" . }} +{{ end }} diff --git a/themes/hugo-book/layouts/landing.html b/themes/hugo-book/layouts/landing.html new file mode 100644 index 0000000..76b8637 --- /dev/null +++ b/themes/hugo-book/layouts/landing.html @@ -0,0 +1,15 @@ +{{ define "menu-container" }} + +{{ end }} +{{ define "toc-container" }} + +{{ end }} +{{ define "footer" }} + +{{ end }} + +{{ define "header" }} + +{{ end }} diff --git a/themes/hugo-book/layouts/list.html b/themes/hugo-book/layouts/list.html new file mode 100644 index 0000000..0dc8b68 --- /dev/null +++ b/themes/hugo-book/layouts/list.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 deleted file mode 100644 index fa7f415..0000000 --- a/themes/hugo-book/layouts/partials/docs/brand.html +++ /dev/null @@ -1,8 +0,0 @@ -

- - {{- 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 deleted file mode 100644 index 59c5f22..0000000 --- a/themes/hugo-book/layouts/partials/docs/comments.html +++ /dev/null @@ -1,2 +0,0 @@ - -{{ template "_internal/disqus.html" . }} diff --git a/themes/hugo-book/layouts/partials/docs/date.html b/themes/hugo-book/layouts/partials/docs/date.html deleted file mode 100644 index 8c75361..0000000 --- a/themes/hugo-book/layouts/partials/docs/date.html +++ /dev/null @@ -1,6 +0,0 @@ - -{{- $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 deleted file mode 100644 index 77e96d8..0000000 --- a/themes/hugo-book/layouts/partials/docs/footer.html +++ /dev/null @@ -1,27 +0,0 @@ -
- -{{ 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 deleted file mode 100644 index 646b8ff..0000000 --- a/themes/hugo-book/layouts/partials/docs/header.html +++ /dev/null @@ -1,13 +0,0 @@ -
- - -

{{ 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 deleted file mode 100644 index 8278050..0000000 --- a/themes/hugo-book/layouts/partials/docs/html-head-favicon.html +++ /dev/null @@ -1 +0,0 @@ - \ 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 deleted file mode 100644 index 49a109d..0000000 --- a/themes/hugo-book/layouts/partials/docs/html-head-title.html +++ /dev/null @@ -1 +0,0 @@ -{{ 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 deleted file mode 100644 index 6a6d0ec..0000000 --- a/themes/hugo-book/layouts/partials/docs/html-head.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - -{{- 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 deleted file mode 100644 index e69de29..0000000 diff --git a/themes/hugo-book/layouts/partials/docs/inject/content-after.html b/themes/hugo-book/layouts/partials/docs/inject/content-after.html deleted file mode 100644 index e69de29..0000000 diff --git a/themes/hugo-book/layouts/partials/docs/inject/content-before.html b/themes/hugo-book/layouts/partials/docs/inject/content-before.html deleted file mode 100644 index e69de29..0000000 diff --git a/themes/hugo-book/layouts/partials/docs/inject/footer.html b/themes/hugo-book/layouts/partials/docs/inject/footer.html deleted file mode 100644 index e69de29..0000000 diff --git a/themes/hugo-book/layouts/partials/docs/inject/head.html b/themes/hugo-book/layouts/partials/docs/inject/head.html deleted file mode 100644 index e69de29..0000000 diff --git a/themes/hugo-book/layouts/partials/docs/inject/menu-after.html b/themes/hugo-book/layouts/partials/docs/inject/menu-after.html deleted file mode 100644 index e69de29..0000000 diff --git a/themes/hugo-book/layouts/partials/docs/inject/menu-before.html b/themes/hugo-book/layouts/partials/docs/inject/menu-before.html deleted file mode 100644 index e69de29..0000000 diff --git a/themes/hugo-book/layouts/partials/docs/inject/toc-after.html b/themes/hugo-book/layouts/partials/docs/inject/toc-after.html deleted file mode 100644 index e69de29..0000000 diff --git a/themes/hugo-book/layouts/partials/docs/inject/toc-before.html b/themes/hugo-book/layouts/partials/docs/inject/toc-before.html deleted file mode 100644 index e69de29..0000000 diff --git a/themes/hugo-book/layouts/partials/docs/languages.html b/themes/hugo-book/layouts/partials/docs/languages.html deleted file mode 100644 index 51aabdd..0000000 --- a/themes/hugo-book/layouts/partials/docs/languages.html +++ /dev/null @@ -1,33 +0,0 @@ - -{{ $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 deleted file mode 100644 index 8ab9334..0000000 --- a/themes/hugo-book/layouts/partials/docs/links/commit.html +++ /dev/null @@ -1,2 +0,0 @@ -{{- $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 deleted file mode 100644 index 920affa..0000000 --- a/themes/hugo-book/layouts/partials/docs/links/edit.html +++ /dev/null @@ -1,2 +0,0 @@ -{{- $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 deleted file mode 100644 index 1494588..0000000 --- a/themes/hugo-book/layouts/partials/docs/menu-filetree.html +++ /dev/null @@ -1,49 +0,0 @@ -{{ $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 deleted file mode 100644 index 5f01be0..0000000 --- a/themes/hugo-book/layouts/partials/docs/menu-hugo.html +++ /dev/null @@ -1,28 +0,0 @@ - -{{ 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 deleted file mode 100644 index dbb2e49..0000000 --- a/themes/hugo-book/layouts/partials/docs/menu.html +++ /dev/null @@ -1,21 +0,0 @@ - - - -{{ $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 deleted file mode 100644 index 457e2c0..0000000 --- a/themes/hugo-book/layouts/partials/docs/post-meta.html +++ /dev/null @@ -1,16 +0,0 @@ -{{ 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 deleted file mode 100644 index 937f595..0000000 --- a/themes/hugo-book/layouts/partials/docs/search.html +++ /dev/null @@ -1,8 +0,0 @@ -{{ 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 deleted file mode 100644 index 63ef315..0000000 --- a/themes/hugo-book/layouts/partials/docs/taxonomy.html +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/themes/hugo-book/layouts/partials/docs/title.html b/themes/hugo-book/layouts/partials/docs/title.html deleted file mode 100644 index 83df5b6..0000000 --- a/themes/hugo-book/layouts/partials/docs/title.html +++ /dev/null @@ -1,17 +0,0 @@ - -{{ $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 deleted file mode 100644 index 64697a4..0000000 --- a/themes/hugo-book/layouts/partials/docs/toc.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ 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 index aff32f5..0d7df53 100644 --- a/themes/hugo-book/layouts/posts/list.html +++ b/themes/hugo-book/layouts/posts/list.html @@ -1,22 +1,39 @@ {{ define "main" }} {{ range sort .Paginator.Pages }} -
+

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

- {{ partial "docs/post-meta" . }} -
- {{- .Summary -}} - {{ if .Truncated }} - ... - {{ end }} +
+
+ {{ partial "docs/post-meta" . }} +
+ {{- .Summary | truncate 256 -}} +
+
+ {{- $thumbnail := default "thumbnail.*" .Params.BookPostThumbnail -}} + {{- with or (.Resources.GetMatch $thumbnail) (resources.GetMatch $thumbnail) -}} +
+ +
+ {{- end -}}
{{ end }} +{{ end }} - {{ template "_internal/pagination.html" . }} +{{ define "toc-container" }} + {{ end }} {{ define "toc" }} {{ partial "docs/taxonomy" . }} {{ end }} + +{{ define "footer" }} + {{ partial "docs/pagination.html" . }} +{{ end }} \ No newline at end of file diff --git a/themes/hugo-book/layouts/posts/single.html b/themes/hugo-book/layouts/posts/single.html index cebdd11..232e14e 100644 --- a/themes/hugo-book/layouts/posts/single.html +++ b/themes/hugo-book/layouts/posts/single.html @@ -1,10 +1,10 @@ {{ define "main" }}

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

{{ partial "docs/post-meta" . }} -
+
{{- .Content -}}
@@ -13,3 +13,7 @@ {{ define "toc" }} {{ partial "docs/toc" . }} {{ end }} + +{{ define "footer" }} + {{ partial "docs/post-prev-next" . }} +{{ end }} \ No newline at end of file diff --git a/themes/hugo-book/layouts/shortcodes/button.html b/themes/hugo-book/layouts/shortcodes/button.html deleted file mode 100644 index efae3e0..0000000 --- a/themes/hugo-book/layouts/shortcodes/button.html +++ /dev/null @@ -1,12 +0,0 @@ -{{- $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 deleted file mode 100644 index bb01da9..0000000 --- a/themes/hugo-book/layouts/shortcodes/columns.html +++ /dev/null @@ -1,9 +0,0 @@ -{{- $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 deleted file mode 100644 index a80209b..0000000 --- a/themes/hugo-book/layouts/shortcodes/details.html +++ /dev/null @@ -1,7 +0,0 @@ -
- {{- $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 deleted file mode 100644 index 95e4f83..0000000 --- a/themes/hugo-book/layouts/shortcodes/hint.html +++ /dev/null @@ -1,3 +0,0 @@ -
- {{ .Inner | safeHTML }} -
diff --git a/themes/hugo-book/layouts/shortcodes/html.html b/themes/hugo-book/layouts/shortcodes/html.html deleted file mode 100644 index b447d45..0000000 --- a/themes/hugo-book/layouts/shortcodes/html.html +++ /dev/null @@ -1 +0,0 @@ -{{- .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 deleted file mode 100644 index b65f70a..0000000 --- a/themes/hugo-book/layouts/shortcodes/i18n.html +++ /dev/null @@ -1,2 +0,0 @@ -{{- $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 deleted file mode 100644 index 4eafc35..0000000 --- a/themes/hugo-book/layouts/shortcodes/katex.html +++ /dev/null @@ -1,13 +0,0 @@ -{{- 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 deleted file mode 100644 index 07a3bfc..0000000 --- a/themes/hugo-book/layouts/shortcodes/mermaid.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ 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 deleted file mode 100644 index b700ec4..0000000 --- a/themes/hugo-book/layouts/shortcodes/section.html +++ /dev/null @@ -1,13 +0,0 @@ -{{- 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 deleted file mode 100644 index b5a753d..0000000 --- a/themes/hugo-book/layouts/shortcodes/tab.html +++ /dev/null @@ -1,9 +0,0 @@ -{{- $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 deleted file mode 100644 index fecbbeb..0000000 --- a/themes/hugo-book/layouts/shortcodes/tabs.html +++ /dev/null @@ -1,3 +0,0 @@ -
-{{ .Inner }} -
diff --git a/themes/hugo-book/layouts/single.html b/themes/hugo-book/layouts/single.html new file mode 100644 index 0000000..0dc8b68 --- /dev/null +++ b/themes/hugo-book/layouts/single.html @@ -0,0 +1 @@ +{{ define "dummy" }}{{ end }} diff --git a/themes/hugo-book/layouts/taxonomy/list.html b/themes/hugo-book/layouts/taxonomy/list.html deleted file mode 100644 index 1d3e763..0000000 --- a/themes/hugo-book/layouts/taxonomy/list.html +++ /dev/null @@ -1,13 +0,0 @@ -{{ 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 deleted file mode 100644 index badf0f6..0000000 --- a/themes/hugo-book/layouts/taxonomy/taxonomy.html +++ /dev/null @@ -1,22 +0,0 @@ -{{ define "main" }} - {{ range sort .Paginator.Pages }} - - {{ end }} - - {{ template "_internal/pagination.html" . }} -{{ end }} - -{{ define "toc" }} - {{ partial "docs/taxonomy" . }} -{{ end }} diff --git a/themes/hugo-book/layouts/term.html b/themes/hugo-book/layouts/term.html new file mode 100644 index 0000000..1bae9a0 --- /dev/null +++ b/themes/hugo-book/layouts/term.html @@ -0,0 +1,27 @@ +{{ define "main" }} + {{ range sort .Paginator.Pages }} + + {{ end }} + + {{ template "_internal/pagination.html" . }} +{{ end }} + +{{ define "toc-container" }} + +{{ end }} + +{{ define "toc" }} + {{ partial "docs/taxonomy" . }} +{{ end }} -- cgit v1.2.3