diff --git a/archetypes/chapter.md b/archetypes/chapter.md index e80bae2fdf..e64c1b02e8 100644 --- a/archetypes/chapter.md +++ b/archetypes/chapter.md @@ -1,6 +1,6 @@ +++ -archetype = "chapter" title = "{{ replace .Name "-" " " | title }}" +type = "chapter" weight = 1 +++ diff --git a/archetypes/home.md b/archetypes/home.md index 423ad0be60..5cbc1b0c38 100644 --- a/archetypes/home.md +++ b/archetypes/home.md @@ -1,6 +1,6 @@ +++ -archetype = "home" title = "{{ replace .Name "-" " " | title }}" +type = "home" +++ This is a new home page. diff --git a/assets/css/format-print.css b/assets/css/format-print.css index 9c1f8940fa..930447b74e 100644 --- a/assets/css/format-print.css +++ b/assets/css/format-print.css @@ -137,7 +137,7 @@ h1 + .footline{ #R-body .topbar-sidebar-divider { border-width: 0; } -.term-list { +article .R-taxonomy { display: none; } mark.search { diff --git a/assets/css/variant.css b/assets/css/variant.css index 752a5a9d49..8cfb38c14c 100644 --- a/assets/css/variant.css +++ b/assets/css/variant.css @@ -404,21 +404,21 @@ pre:not(.mermaid) .copy-to-clipboard-button:hover { --VARIABLE-BOX-TEXT-color: var(--VARIABLE-BOX-CAPTION-color); } -#R-body .tags { +article .R-taxonomy.tags { --VARIABLE-TAGS-color: var(--INTERNAL-MAIN-BG-color); --VARIABLE-TAGS-BG-color: var(--VARIABLE-BOX-color); } -#R-body .tags a.term-link { +article .R-taxonomy.tags a.term-link { background-color: var(--VARIABLE-TAGS-BG-color); color: var(--VARIABLE-TAGS-color); } -#R-body .tags a.term-link:before { +article .R-taxonomy.tags a.term-link:before { border-right-color: var(--VARIABLE-TAGS-BG-color); } -#R-body .tags a.term-link:after { +article .R-taxonomy.tags a.term-link:after { background-color: var(--VARIABLE-TAGS-color); } diff --git a/exampleSite/content/_index.en.md b/exampleSite/content/_index.en.md index bfb2e60471..9fe95b490d 100644 --- a/exampleSite/content/_index.en.md +++ b/exampleSite/content/_index.en.md @@ -1,7 +1,7 @@ +++ -archetype = "home" description = "A theme for Hugo designed for documentation." title = "Hugo Relearn Theme" +type = "home" +++ {{% replaceRE "https://mcshelby.github.io/hugo-theme-relearn/" "" %}} {{< include "README.md" "true" >}} diff --git a/exampleSite/content/_index.pir.md b/exampleSite/content/_index.pir.md index b8d2929ea9..2648525a72 100644 --- a/exampleSite/content/_index.pir.md +++ b/exampleSite/content/_index.pir.md @@ -1,6 +1,6 @@ +++ -archetype = "home" description = "A theme fer Cap'n Hugo designed fer documentat'n." title = "Cap'n Hugo Relearrrn Theme" +type = "home" +++ {{< piratify true >}} \ No newline at end of file diff --git a/exampleSite/content/basics/_index.en.md b/exampleSite/content/basics/_index.en.md index 9fb8254742..290c716fc2 100755 --- a/exampleSite/content/basics/_index.en.md +++ b/exampleSite/content/basics/_index.en.md @@ -1,6 +1,6 @@ +++ -archetype = "chapter" title = "Basics" +type = "chapter" weight = 1 +++ diff --git a/exampleSite/content/basics/_index.pir.md b/exampleSite/content/basics/_index.pir.md index e7fd897587..43dbfe1d5f 100644 --- a/exampleSite/content/basics/_index.pir.md +++ b/exampleSite/content/basics/_index.pir.md @@ -1,6 +1,6 @@ +++ -archetype = "chapter" title = "Basics" +type = "chapter" weight = 1 +++ {{< piratify >}} \ No newline at end of file diff --git a/exampleSite/content/cont/_index.en.md b/exampleSite/content/cont/_index.en.md index 7e7194ee48..59f1e928bd 100755 --- a/exampleSite/content/cont/_index.en.md +++ b/exampleSite/content/cont/_index.en.md @@ -1,6 +1,6 @@ +++ -archetype = "chapter" title = "Content" +type = "chapter" weight = 2 +++ diff --git a/exampleSite/content/cont/_index.pir.md b/exampleSite/content/cont/_index.pir.md index 91668dc477..3846243d46 100644 --- a/exampleSite/content/cont/_index.pir.md +++ b/exampleSite/content/cont/_index.pir.md @@ -1,6 +1,6 @@ +++ -archetype = "chapter" title = "Rambl'n" +type = "chapter" weight = 2 +++ {{< piratify >}} \ No newline at end of file diff --git a/exampleSite/content/cont/archetypes/_index.en.md b/exampleSite/content/cont/archetypes/_index.en.md index 0d0fc5d54d..f61c96b62d 100644 --- a/exampleSite/content/cont/archetypes/_index.en.md +++ b/exampleSite/content/cont/archetypes/_index.en.md @@ -25,8 +25,8 @@ This leads to a file with the following content ````toml {title="_index.md"} +++ -archetype = "home" title = "{{ replace .Name "-" " " | title }}" +type = "home" +++ Lorem Ipsum. @@ -48,8 +48,8 @@ This leads to a file with the following content ````toml {title="_index.md"} +++ -archetype = "chapter" title = "{{ replace .Name "-" " " | title }}" +type = "chapter" weight = 1 +++ @@ -96,7 +96,7 @@ Define a template file in your project at `archetypes/.md` and make sure i ````toml {title="<kind>.md"} +++ -archetype = "" +type = "" +++ ```` diff --git a/exampleSite/content/dev/_index.en.md b/exampleSite/content/dev/_index.en.md index aa2b2f8e74..b59b3f543e 100644 --- a/exampleSite/content/dev/_index.en.md +++ b/exampleSite/content/dev/_index.en.md @@ -1,7 +1,7 @@ +++ -archetype = "chapter" hidden = true title = "Development" +type = "chapter" weight = 4 +++ diff --git a/exampleSite/content/dev/_index.pir.md b/exampleSite/content/dev/_index.pir.md index 20fdf7e2ab..980eb81bd2 100644 --- a/exampleSite/content/dev/_index.pir.md +++ b/exampleSite/content/dev/_index.pir.md @@ -1,7 +1,7 @@ +++ -archetype = "chapter" hidden = true title = "Development" +type = "chapter" weight = 4 +++ {{< piratify >}} \ No newline at end of file diff --git a/exampleSite/content/shortcodes/_index.en.md b/exampleSite/content/shortcodes/_index.en.md index 43583410d5..21530522e7 100644 --- a/exampleSite/content/shortcodes/_index.en.md +++ b/exampleSite/content/shortcodes/_index.en.md @@ -1,7 +1,7 @@ +++ -archetype = "chapter" -title = "Shortcodes" ordersectionsby = "title" +title = "Shortcodes" +type = "chapter" weight = 3 +++ diff --git a/exampleSite/content/shortcodes/_index.pir.md b/exampleSite/content/shortcodes/_index.pir.md index b06e4fce0a..90f3c89184 100644 --- a/exampleSite/content/shortcodes/_index.pir.md +++ b/exampleSite/content/shortcodes/_index.pir.md @@ -1,7 +1,7 @@ +++ -archetype = "chapter" -title = "Shorrrtcodes" ordersectionsby = "title" +title = "Shorrrtcodes" +type = "chapter" weight = 3 +++ {{< piratify >}} \ No newline at end of file diff --git a/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-2/children-1-1-2-1/_index.en.md b/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-2/children-1-1-2-1/_index.en.md index 74e144d8a3..118f162b56 100644 --- a/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-2/children-1-1-2-1/_index.en.md +++ b/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-2/children-1-1-2-1/_index.en.md @@ -4,4 +4,4 @@ tags = ["children", "non-hidden"] title = "page 1-1-2-1" +++ -This is a plain demo child page. +This is a plain demo child page 1-1-2-1. diff --git a/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-2/children-1-1-2-2/_index.en.md b/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-2/children-1-1-2-2/_index.en.md index 41f730e1c7..3ae33d8ab6 100644 --- a/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-2/children-1-1-2-2/_index.en.md +++ b/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-2/children-1-1-2-2/_index.en.md @@ -4,4 +4,4 @@ tags = ["children", "non-hidden"] title = "page 1-1-2-2" +++ -This is a plain demo child page. +This is a plain demo child page 1-1-2-2. diff --git a/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-3/_index.en.md b/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-3/_index.en.md index df890459b5..a56baa5343 100644 --- a/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-3/_index.en.md +++ b/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-3/_index.en.md @@ -4,4 +4,4 @@ tags = ["children", "non-hidden"] title = "page 1-1-3" +++ -This is a plain demo child page. +This is a plain demo child page 1-1-3. diff --git a/exampleSite/content/shortcodes/children/children-3/test3.en.md b/exampleSite/content/shortcodes/children/children-3/test3.en.md index c8cf6d910e..fb1bed8f9a 100644 --- a/exampleSite/content/shortcodes/children/children-3/test3.en.md +++ b/exampleSite/content/shortcodes/children/children-3/test3.en.md @@ -4,4 +4,4 @@ tags = ["children", "non-hidden"] title = "page 3-1" +++ -This is a plain demo child page. +This is a plain demo child page 3-1. diff --git a/exampleSite/content/shortcodes/children/test.en.md b/exampleSite/content/shortcodes/children/test.en.md index 68fb26bfad..a2c58a090e 100644 --- a/exampleSite/content/shortcodes/children/test.en.md +++ b/exampleSite/content/shortcodes/children/test.en.md @@ -7,4 +7,4 @@ title: "page X" weight: 1 --- -This is a plain demo child page. +This is a plain demo child page X. diff --git a/exampleSite/layouts/partials/menu-pre.html b/exampleSite/layouts/partials/menu-pre.html index 56200b4bc5..eb58e01454 100644 --- a/exampleSite/layouts/partials/menu-pre.html +++ b/exampleSite/layouts/partials/menu-pre.html @@ -1 +1 @@ -{{ if (eq .Params.archetype "chapter") }}{{ .Params.weight }}. {{ end }} \ No newline at end of file +{{ if (eq .Type "chapter") }}{{ .Params.weight }}. {{ end }} \ No newline at end of file diff --git a/layouts/404.html b/layouts/404.html index ee18026dd7..0b59e58f8a 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,18 +1,22 @@ - {{- partialCached "page-meta.hugo" . .RelPermalink }} +{{- .Store.Set "relearnOutputFormat" "notfound" -}} + {{- partial "meta.html" . }} {{- $title := partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) }} {{ $title }} + + {{- /* because this file can be called from literally any URL inside your project, we need to base all relative URLs to make them work */}} + {{- partialCached "favicon.html" . }} {{- partial "stylesheet.html" . }} {{- partial "custom-header.html" . }} - +
-
+

4{{ partial "shortcodes/icon.html" (dict "page" . "icon" "far fa-frown" )}}4

diff --git a/layouts/partials/header.html b/layouts/_default/baseof.html similarity index 68% rename from layouts/partials/header.html rename to layouts/_default/baseof.html index bd3e83e003..70e88e4155 100644 --- a/layouts/partials/header.html +++ b/layouts/_default/baseof.html @@ -1,5 +1,6 @@ +{{- partialCached "page-meta.hugo" . .RelPermalink -}} -{{- $outputFormat := partial "output-format.hugo" . }} +{{- block "storeOutputFormat" . }}{{ end }} {{- if eq . .Site.Sites.First.Home }} {{- $hugoVersion := "0.126.0" }} {{- if lt hugo.Version $hugoVersion }} @@ -12,11 +13,10 @@ {{- partial "meta.html" . }} - {{- $page := . }} - {{- $link := "" }} {{- $title := partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) }} {{ $title }} + {{- /* multilingual stuff */}} {{- if .IsTranslated -}} {{- range $index, $trans := .AllTranslations }} {{- if eq $index 0 }} @@ -26,8 +26,11 @@ {{- end }} {{- end }} + {{- /* output formats */}} {{- if not (and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }} {{- else }} + {{- $page := . }} + {{- $link := "" }} {{- range .AlternativeOutputFormats }} {{- if eq .Rel "canonical" }} {{ (printf $link (partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }} @@ -36,13 +39,12 @@ {{- end }} {{- end }} {{- end }} - {{- partialCached "favicon.html" . }} {{- partial "stylesheet.html" . }} {{- partial "dependencies.html" (dict "page" . "location" "header") }} {{- partial "custom-header.html" . }} - +
- {{- $hook := "styleclass" }}
-
-
\ No newline at end of file +
+
+{{- block "body" . }}{{ end }} +
+
+{{- partial "custom-comments.html" . }} +
+{{- block "menu" . }}{{ end }} +{{- $assetBusting := partialCached "assetbusting.hugo" . }} + + +{{- partial "dependencies.html" (dict "page" . "location" "footer") }} + +{{- partial "custom-footer.html" . }} + + diff --git a/layouts/_default/index.html b/layouts/_default/index.html deleted file mode 100644 index f85131ad5e..0000000000 --- a/layouts/_default/index.html +++ /dev/null @@ -1 +0,0 @@ -{{- partial "_main.hugo" . }} \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index f85131ad5e..678546c49b 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1 +1,9 @@ -{{- partial "_main.hugo" . }} \ No newline at end of file +{{- define "storeOutputFormat" }} + {{- .Render "views/storeOutputFormat" }} +{{- end }} +{{- define "body" }} + {{- .Render "views/page" }} +{{- end }} +{{- define "menu" }} + {{- .Render "views/menu" }} +{{- end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index f85131ad5e..678546c49b 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1 +1,9 @@ -{{- partial "_main.hugo" . }} \ No newline at end of file +{{- define "storeOutputFormat" }} + {{- .Render "views/storeOutputFormat" }} +{{- end }} +{{- define "body" }} + {{- .Render "views/page" }} +{{- end }} +{{- define "menu" }} + {{- .Render "views/menu" }} +{{- end }} \ No newline at end of file diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index dcf3bfba98..e995a03c05 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -1,33 +1,9 @@ -{{- partialCached "page-meta.hugo" . .RelPermalink }} -{{- partial "header.html" . }} -
-
-
-{{- $page := . }} - -{{- $title := partial "pageHelper/title.hugo" (dict "page" .) }} -

{{ $title }}

-{{- .Content }} -{{- $lastCapital := "" }} -{{- $pages := partialCached "partials/pageHelper/taxonomyPages.html" . . }} -{{- range $pages }} - {{- $capital := substr .Title 0 1 | upper }} - {{- if ne $lastCapital $capital }} - {{- if ne $lastCapital "" }} - - {{- end }} -

{{ $capital }}

-
    - {{- end }} - {{- /* display terms of a taxonomy */}} -
  • {{ .Title }} ({{ .Count }})
  • - {{- $lastCapital = $capital }} +{{- define "storeOutputFormat" }} + {{- .Render "views/storeOutputFormat" }} {{- end }} -{{- if ne $lastCapital "" }} -
+{{- define "body" }} + {{- partial "bodys/taxonomy.html" . }} {{- end }} - -
-
-
-{{- partial "footer.html" . }} \ No newline at end of file +{{- define "menu" }} + {{- .Render "views/menu" }} +{{- end }} \ No newline at end of file diff --git a/layouts/_default/term.html b/layouts/_default/term.html index 7ddd7dff6d..eafcaab0f4 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -1,37 +1,9 @@ -{{- partialCached "page-meta.hugo" . .RelPermalink }} -{{- partial "header.html" . }} -
-
-
-{{- $page := . }} - -{{- $title := partial "pageHelper/title.hugo" (dict "page" .) }} -

{{ $title }}

-{{- .Content }} -{{- $lastCapital := "" }} -{{- $pages := partialCached "partials/pageHelper/termPages.html" . . }} -{{- range $pages }} - {{- $capital := substr .Title 0 1 | upper }} - {{- if ne $lastCapital $capital }} - {{- if ne $lastCapital "" }} - - {{- end }} -

{{ $capital }}

-
    - {{- end }} - {{- /* display pages of a term */}} - {{- $breadcrumb := "" }} - {{- if (ne .Page.Site.Params.disableTermBreadcrumbs true) }} - {{- $breadcrumb = trim (partial "breadcrumbs.html" (dict "page" .Page "dirOnly" true) | plainify | htmlUnescape) "\n\r\t " }} - {{- end }} -
  • {{ .Title }}{{ with $breadcrumb }}{{ end }}
  • - {{- $lastCapital = $capital }} +{{- define "storeOutputFormat" }} + {{- .Render "views/storeOutputFormat" }} {{- end }} -{{- if ne $lastCapital "" }} -
+{{- define "body" }} + {{- partial "bodys/term.html" . }} {{- end }} - -
-
-
-{{- partial "footer.html" . }} \ No newline at end of file +{{- define "menu" }} + {{- .Render "views/menu" }} +{{- end }} \ No newline at end of file diff --git a/layouts/partials/archetypes/default/article.html b/layouts/_default/views/article.html similarity index 74% rename from layouts/partials/archetypes/default/article.html rename to layouts/_default/views/article.html index 801b462c75..4066247117 100644 --- a/layouts/partials/archetypes/default/article.html +++ b/layouts/_default/views/article.html @@ -1,15 +1,12 @@ -{{- $page := .page }} -{{- $content := .content }} -{{- with $page }} +
{{- partial "content-header.html" . }}
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }} -{{ $content | safeHTML }} +{{ partial "content.html" . | safeHTML }}
{{- partial "content-footer.html" . }}
-
-{{- end }} +
\ No newline at end of file diff --git a/layouts/_default/views/menu.html b/layouts/_default/views/menu.html new file mode 100644 index 0000000000..d45dac8d08 --- /dev/null +++ b/layouts/_default/views/menu.html @@ -0,0 +1 @@ +{{- partial "menu.html" . }} \ No newline at end of file diff --git a/layouts/partials/menu.print.html b/layouts/_default/views/menu.print.html similarity index 100% rename from layouts/partials/menu.print.html rename to layouts/_default/views/menu.print.html diff --git a/layouts/_default/views/page.html b/layouts/_default/views/page.html new file mode 100644 index 0000000000..2598ae47c6 --- /dev/null +++ b/layouts/_default/views/page.html @@ -0,0 +1 @@ +{{- partial "bodys/page-single.html" . }} \ No newline at end of file diff --git a/layouts/_default/views/page.print.html b/layouts/_default/views/page.print.html new file mode 100644 index 0000000000..656a8f4756 --- /dev/null +++ b/layouts/_default/views/page.print.html @@ -0,0 +1 @@ +{{- partial "bodys/page-tree.html" . }} \ No newline at end of file diff --git a/layouts/_default/views/storeOutputFormat.html b/layouts/_default/views/storeOutputFormat.html new file mode 100644 index 0000000000..48f3055903 --- /dev/null +++ b/layouts/_default/views/storeOutputFormat.html @@ -0,0 +1 @@ +{{- .Store.Set "relearnOutputFormat" "html" }} \ No newline at end of file diff --git a/layouts/_default/views/storeOutputFormat.print.html b/layouts/_default/views/storeOutputFormat.print.html new file mode 100644 index 0000000000..e3e0377d80 --- /dev/null +++ b/layouts/_default/views/storeOutputFormat.print.html @@ -0,0 +1 @@ +{{- .Store.Set "relearnOutputFormat" "print" }} \ No newline at end of file diff --git a/layouts/partials/archetypes/chapter/article.html b/layouts/chapter/views/article.html similarity index 71% rename from layouts/partials/archetypes/chapter/article.html rename to layouts/chapter/views/article.html index 30ff708264..33a4cf28b4 100644 --- a/layouts/partials/archetypes/chapter/article.html +++ b/layouts/chapter/views/article.html @@ -1,16 +1,13 @@ -{{- $page := .page }} -{{- $content := .content }} -{{- with $page }} -
+ +
{{- partial "content-header.html" . }}
{{ partial "heading-pre.html" . }}
{{ T "Chapter" .Params.Weight }}
{{ partial "heading.html" . }}{{ partial "heading-post.html" . }} -{{ $content | safeHTML }} +{{ partial "content.html" . | safeHTML }}
{{- partial "content-footer.html" . }}
-
-{{- end }} +
\ No newline at end of file diff --git a/layouts/partials/archetypes/home/article.html b/layouts/home/views/article.html similarity index 74% rename from layouts/partials/archetypes/home/article.html rename to layouts/home/views/article.html index 0ff610b64a..cfcd66b837 100644 --- a/layouts/partials/archetypes/home/article.html +++ b/layouts/home/views/article.html @@ -1,15 +1,12 @@ -{{- $page := .page }} -{{- $content := .content }} -{{- with $page }} +
{{- partial "content-header.html" . }}
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }} -{{ $content | safeHTML }} +{{ partial "content.html" . | safeHTML }}
{{- partial "content-footer.html" . }}
-
-{{- end }} + \ No newline at end of file diff --git a/layouts/partials/_main.hugo b/layouts/partials/_main.hugo deleted file mode 100644 index 4d2e7e639e..0000000000 --- a/layouts/partials/_main.hugo +++ /dev/null @@ -1,8 +0,0 @@ -{{- partialCached "page-meta.hugo" . .RelPermalink }} -{{- partial "output-partial.hugo" (dict "base" "header" "page" . "parameter" .) }} -{{- if not .File }} - {{- partial "output-partial.hugo" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "output-partial.hugo" (dict "base" "initial" "page" . "parameter" .)))) }} -{{- else }} - {{- partial "output-partial.hugo" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "output-partial.hugo" (dict "base" "content" "page" . "parameter" .)))) }} -{{- end }} -{{- partial "output-partial.hugo" (dict "base" "footer" "page" . "parameter" .) }} \ No newline at end of file diff --git a/layouts/partials/archetype.hugo b/layouts/partials/archetype.hugo deleted file mode 100644 index 2acd25525c..0000000000 --- a/layouts/partials/archetype.hugo +++ /dev/null @@ -1,23 +0,0 @@ -{{- $hook := .hook }} -{{- $page := .page }} -{{- $parameter := .parameter }} -{{- $archetype := "default" }} -{{- if not $page.File }} -{{- else if $page.Params.archetype }} - {{- $archetype = $page.Params.archetype }} -{{- else if $page.Params.chapter }} - {{- $archetype = "chapter" }} - {{- if findRE `(?s).*?` .Content }} - {{- $archetype = "deprecated-chapter" }} - {{- end }} -{{- else if $page.IsHome }} - {{- $archetype = "home" }} - {{- if findRE `(?s).*?` .Content }} - {{- $archetype = "deprecated-home" }} - {{- end }} -{{- end }} -{{- $f := printf "/layouts/partials/archetypes/%s" $archetype }} -{{- if not (partialCached "fileExists.hugo" $f $f) }} - {{- $archetype = "default" }} -{{- end }} -{{- partial "output-partial.hugo" (dict "base" (printf "archetypes/%s/%s" $archetype $hook) "page" $page "parameter" $parameter) }} \ No newline at end of file diff --git a/layouts/partials/archetypes/chapter/styleclass.html b/layouts/partials/archetypes/chapter/styleclass.html deleted file mode 100644 index 0dd7c8ffbc..0000000000 --- a/layouts/partials/archetypes/chapter/styleclass.html +++ /dev/null @@ -1 +0,0 @@ -chapter narrow \ No newline at end of file diff --git a/layouts/partials/archetypes/default/styleclass.html b/layouts/partials/archetypes/default/styleclass.html deleted file mode 100644 index 331d858ce9..0000000000 --- a/layouts/partials/archetypes/default/styleclass.html +++ /dev/null @@ -1 +0,0 @@ -default \ No newline at end of file diff --git a/layouts/partials/archetypes/deprecated-chapter/article.html b/layouts/partials/archetypes/deprecated-chapter/article.html deleted file mode 100644 index f58dc10743..0000000000 --- a/layouts/partials/archetypes/deprecated-chapter/article.html +++ /dev/null @@ -1,15 +0,0 @@ -{{- $page := .page }} -{{- $content := .content }} -{{- with $page }} - {{- warnf "%q: DEPRECATED usage of old 'chapter' archetype found, remove 'chapter=true' and add 'archetype=\"chapter\"' to your frontmatter and remove the leading h3 and h1 headings; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#500" $page.File.Filename }} -
-
- {{- partial "content-header.html" . }} -
- -{{ $content | safeHTML }} -
- {{- partial "content-footer.html" . }} -
-
-{{- end }} diff --git a/layouts/partials/archetypes/deprecated-chapter/styleclass.html b/layouts/partials/archetypes/deprecated-chapter/styleclass.html deleted file mode 100644 index 0dd7c8ffbc..0000000000 --- a/layouts/partials/archetypes/deprecated-chapter/styleclass.html +++ /dev/null @@ -1 +0,0 @@ -chapter narrow \ No newline at end of file diff --git a/layouts/partials/archetypes/deprecated-home/article.html b/layouts/partials/archetypes/deprecated-home/article.html deleted file mode 100644 index 196fc5a9fa..0000000000 --- a/layouts/partials/archetypes/deprecated-home/article.html +++ /dev/null @@ -1,15 +0,0 @@ -{{- $page := .page }} -{{- $content := .content }} -{{- with $page }} - {{- warnf "%q: DEPRECATED usage of old 'home' archetype found, add 'archetype=\"home\"' to your frontmatter and remove the leading h1 heading; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#500" $page.File.Filename }} -
-
- {{- partial "content-header.html" . }} -
- -{{ $content | safeHTML }} -
- {{- partial "content-footer.html" . }} -
-
-{{- end }} diff --git a/layouts/partials/archetypes/deprecated-home/styleclass.html b/layouts/partials/archetypes/deprecated-home/styleclass.html deleted file mode 100644 index 0247178b6e..0000000000 --- a/layouts/partials/archetypes/deprecated-home/styleclass.html +++ /dev/null @@ -1 +0,0 @@ -home \ No newline at end of file diff --git a/layouts/partials/archetypes/home/styleclass.html b/layouts/partials/archetypes/home/styleclass.html deleted file mode 100644 index 0247178b6e..0000000000 --- a/layouts/partials/archetypes/home/styleclass.html +++ /dev/null @@ -1 +0,0 @@ -home \ No newline at end of file diff --git a/layouts/partials/article.html b/layouts/partials/article.html deleted file mode 100644 index e4e433c302..0000000000 --- a/layouts/partials/article.html +++ /dev/null @@ -1,4 +0,0 @@ -{{- $page := .page }} -{{- $content := .content }} -{{- $hook := "article" }} -{{- partialCached "archetype.hugo" (dict "hook" $hook "page" $page "parameter" (dict "page" $page "content" $content)) $page.RelPermalink $hook }} \ No newline at end of file diff --git a/layouts/partials/body.html b/layouts/partials/body.html deleted file mode 100644 index 8c48acf563..0000000000 --- a/layouts/partials/body.html +++ /dev/null @@ -1,3 +0,0 @@ -{{- $page := .page }} -{{- $content := .content }} -{{- partial "single-article.hugo" (dict "page" $page "content" $content) }} \ No newline at end of file diff --git a/layouts/partials/body.print.html b/layouts/partials/body.print.html deleted file mode 100644 index bb35642354..0000000000 --- a/layouts/partials/body.print.html +++ /dev/null @@ -1,3 +0,0 @@ -{{- $page := .page }} -{{- $content := .content }} -{{- partial "nested-article.hugo" (dict "page" $page) }} \ No newline at end of file diff --git a/layouts/partials/bodys/page-single.html b/layouts/partials/bodys/page-single.html new file mode 100644 index 0000000000..683da10ecd --- /dev/null +++ b/layouts/partials/bodys/page-single.html @@ -0,0 +1,2 @@ +{{- .Store.Set "relearnIsNested" false }} +{{- .Render "views/article" }} \ No newline at end of file diff --git a/layouts/partials/nested-article.hugo b/layouts/partials/bodys/page-tree.html similarity index 86% rename from layouts/partials/nested-article.hugo rename to layouts/partials/bodys/page-tree.html index 7a3236987a..2cabcb17ed 100644 --- a/layouts/partials/nested-article.hugo +++ b/layouts/partials/bodys/page-tree.html @@ -1,5 +1,5 @@ -{{- .page.Page.Store.Set "relearnIsNested" true }} -{{- template "section-tree-print" dict "sect" .page "currentnode" .page }} +{{- .Store.Set "relearnIsNested" true }} +{{- template "section-tree-print" dict "sect" . "currentnode" . }} {{- define "section-tree-print" }} {{- $currentNode := .currentnode }} {{- $currentFileRelPermalink := .currentnode.RelPermalink }} @@ -29,11 +29,11 @@ {{- $currentNode := .currentnode }} {{- with .sect }} {{- $page := . }} - {{- partialCached "nested-content.hugo" (dict "page" $page) $page.RelPermalink }} + {{- partialCached "nested-content.hugo" $page $page.RelPermalink }} {{- range $page.Site.Params.relearn.dependencies }} {{- $has := printf "has%s" .name }} {{- $hasnested := printf "relearnHasNested%s" .name }} {{- $currentNode.Page.Store.Set $hasnested (or ($currentNode.Page.Store.Get $hasnested) ($page.Page.Store.Get $has)) }} {{- end }} {{- end }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/layouts/partials/bodys/taxonomy.html b/layouts/partials/bodys/taxonomy.html new file mode 100644 index 0000000000..685a613374 --- /dev/null +++ b/layouts/partials/bodys/taxonomy.html @@ -0,0 +1,30 @@ + +
+
+
+ +{{- $title := partial "pageHelper/title.hugo" (dict "page" .) }} +

{{ $title }}

+{{- .Content }} +{{- $lastCapital := "" }} +{{- $pages := partialCached "partials/pageHelper/taxonomyPages.html" . . }} +{{- range $pages }} + {{- $capital := substr .Title 0 1 | upper }} + {{- if ne $lastCapital $capital }} + {{- if ne $lastCapital "" }} + + {{- end }} +

{{ $capital }}

+
    + {{- end }} + {{- /* display terms of a taxonomy */}} +
  • {{ .Title }} ({{ .Count }})
  • + {{- $lastCapital = $capital }} +{{- end }} +{{- if ne $lastCapital "" }} +
+{{- end }} + +
+
+
\ No newline at end of file diff --git a/layouts/partials/bodys/term.html b/layouts/partials/bodys/term.html new file mode 100644 index 0000000000..b7d2d219e5 --- /dev/null +++ b/layouts/partials/bodys/term.html @@ -0,0 +1,34 @@ + +
+
+
+ +{{- $title := partial "pageHelper/title.hugo" (dict "page" .) }} +

{{ $title }}

+{{- .Content }} +{{- $lastCapital := "" }} +{{- $pages := partialCached "partials/pageHelper/termPages.html" . . }} +{{- range $pages }} + {{- $capital := substr .Title 0 1 | upper }} + {{- if ne $lastCapital $capital }} + {{- if ne $lastCapital "" }} + + {{- end }} +

{{ $capital }}

+
    + {{- end }} + {{- /* display pages of a term */}} + {{- $breadcrumb := "" }} + {{- if (ne .Page.Site.Params.disableTermBreadcrumbs true) }} + {{- $breadcrumb = trim (partial "breadcrumbs.html" (dict "page" .Page "dirOnly" true) | plainify | htmlUnescape) "\n\r\t " }} + {{- end }} +
  • {{ .Title }}{{ with $breadcrumb }}{{ end }}
  • + {{- $lastCapital = $capital }} +{{- end }} +{{- if ne $lastCapital "" }} +
+{{- end }} + +
+
+
\ No newline at end of file diff --git a/layouts/partials/content.html b/layouts/partials/content.html index ceeab0ce02..6647756650 100644 --- a/layouts/partials/content.html +++ b/layouts/partials/content.html @@ -1 +1,4 @@ -{{- .Content }} \ No newline at end of file +{{- /* the following check avoids to print out content of headless bundles if called from nested-content.html */}} +{{- if partial "relLangPrettyUglyURL.hugo" (dict "to" .) }} + {{- .Content }} +{{- end }} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html deleted file mode 100644 index 5a8f9fe8dc..0000000000 --- a/layouts/partials/footer.html +++ /dev/null @@ -1,13 +0,0 @@ -
-
-{{- partial "custom-comments.html" . }} -
-{{- partial "output-partial.hugo" (dict "base" "menu" "page" . "parameter" .) }} -{{- $assetBusting := partialCached "assetbusting.hugo" . }} - - -{{- partial "dependencies.html" (dict "page" . "location" "footer") }} - -{{- partial "custom-footer.html" . }} - - diff --git a/layouts/partials/get-format.hugo b/layouts/partials/get-format.hugo deleted file mode 100644 index c8a0763e05..0000000000 --- a/layouts/partials/get-format.hugo +++ /dev/null @@ -1,44 +0,0 @@ -{{/* - https://discourse.gohugo.io/t/question-about-printf-v/22923/4 - - GetCurrentOutput - Retrieves the OuputFormat of the page, from a list of predefined outputs - - @author @regisphilibert with modification by @McShelby - - @context Page (.) - - @access public - - @return A String among the predefined list - - @example - Go Template - {{ $currentOutputFormat := partial "func/GetCurrentOutput" . }} - - @warning This partial cannot be cached. -*/}} - -{{/* We create a slice listing the concerned output formats */}} -{{- $outputs := slice }} -{{- range .OutputFormats }} - {{- $outputs = $outputs | append .Name }} -{{- end }} -{{- $alt := slice }} -{{/* We range on the page's Alternative Output Formats which returns all output formats -except the current one. */}} -{{- range .AlternativeOutputFormats }} -{{/* If an output format matches one in the concerned list, we add it to our slice of outputs */}} - {{- if in $outputs .Name }} - {{- $alt = $alt | append .Name }} - {{- end }} -{{- end }} -{{- $current := "default" }} -{{/* If any alternate output formats part of the "concerned" ones have been found, we range on them. */}} -{{- range $outputs }} - {{/* If the output format is not listed as an "alternate", it means it is the current one. */}} - {{- if not (in $alt .) }} - {{- $current = . }} - {{- end }} -{{- end }} - -{{- return .OutputFormats.Get $current }} \ No newline at end of file diff --git a/layouts/partials/nested-content.hugo b/layouts/partials/nested-content.hugo index b12972d938..ee81d5c08a 100644 --- a/layouts/partials/nested-content.hugo +++ b/layouts/partials/nested-content.hugo @@ -1,12 +1,3 @@ -{{- $page := .page }} -{{- $content := "" }} -{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" $page) }} -{{- if $url }} - {{- /* if we have a relative link in a print page, our print URL is one level to deep; so we are making it absolute to our page by prepending the page's permalink */}} - {{- $link_prefix := strings.TrimRight "/" $page.RelPermalink }} - {{- $content = partial "output-partial.hugo" (dict "base" "content" "page" $page "parameter" $page) }} - {{- $content = replaceRE "((?:src|href)\\s*=(?:\\s*[\"']\\s*)?)(\\.[^\"'\\s>]*|[\\w]+[^\"'\\s>:]*)([\"'\\s>])" (printf "${1}%s/${2}${3}" $link_prefix) $content }} -{{- end }} -{{- if $page.Title }} - {{- partial "output-partial.hugo" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content)) }} +{{- if .Title }} + {{- .Render "views/article" }} {{- end }} \ No newline at end of file diff --git a/layouts/partials/output-format.hugo b/layouts/partials/output-format.hugo deleted file mode 100644 index 73a02ab08a..0000000000 --- a/layouts/partials/output-format.hugo +++ /dev/null @@ -1,13 +0,0 @@ -{{- $page := . }} -{{- $format := "" }} -{{- if reflect.IsMap $page }} - {{- $format = $page.format }} - {{- $page = $page.page }} -{{- else }} - {{- $format = partial "get-format.hugo" $page }} -{{- end }} -{{- $ret := "default" }} -{{- if $format }} - {{ $ret = $format.Name | lower }} -{{- end }} -{{- return $ret }} \ No newline at end of file diff --git a/layouts/partials/output-partial.hugo b/layouts/partials/output-partial.hugo deleted file mode 100644 index 51a98409fd..0000000000 --- a/layouts/partials/output-partial.hugo +++ /dev/null @@ -1,17 +0,0 @@ -{{- $base := .base }} -{{- $page := .page }} -{{- $parameter := .parameter }} -{{- $outputFormat := .outputFormat }} -{{- if not $outputFormat }} - {{- $outputFormat = partial "output-format.hugo" $page }} -{{- end }} -{{- $suffix := partialCached "output-suffix.hugo" $page $page.RelPermalink $outputFormat }} -{{- $f := printf "/layouts/partials/%s.%s.%s" $base $outputFormat $suffix }} -{{- if or (not $outputFormat) (not (partialCached "fileExists.hugo" $f $f)) }} - {{- $f = printf "/layouts/partials/%s.%s" $base $suffix }} - {{- if partialCached "fileExists.hugo" $f $f }} - {{- partial (printf "%s.%s" $base $suffix) $parameter }} - {{- end }} -{{- else }} - {{- partial (printf "%s.%s.%s" $base $outputFormat $suffix) $parameter }} -{{- end }} \ No newline at end of file diff --git a/layouts/partials/output-suffix.hugo b/layouts/partials/output-suffix.hugo deleted file mode 100644 index f237c002e8..0000000000 --- a/layouts/partials/output-suffix.hugo +++ /dev/null @@ -1,8 +0,0 @@ -{{- $format := partial "get-format.hugo" . }} -{{- $ret := "html" }} -{{- if $format }} - {{- range first 1 $format.MediaType.Suffixes }} - {{- $ret = . }} - {{- end }} -{{- end }} -{{- return $ret }} \ No newline at end of file diff --git a/layouts/partials/page-meta.hugo b/layouts/partials/page-meta.hugo index e72ecb2ee2..7f8d693c80 100644 --- a/layouts/partials/page-meta.hugo +++ b/layouts/partials/page-meta.hugo @@ -1,3 +1,13 @@ + {{- $currentNode := . }} {{- $forceContent := $currentNode.WordCount }} {{- $currentNode.Scratch.Delete "relearnIsSelfFound" }} diff --git a/layouts/partials/single-article.hugo b/layouts/partials/single-article.hugo deleted file mode 100644 index f3099d72cc..0000000000 --- a/layouts/partials/single-article.hugo +++ /dev/null @@ -1,4 +0,0 @@ -{{- $page := .page }} -{{- $content := .content }} -{{- $page.Page.Store.Set "relearnIsNested" false }} -{{- partial "output-partial.hugo" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content)) }} \ No newline at end of file diff --git a/layouts/partials/stylesheet.html b/layouts/partials/stylesheet.html index 64590bbade..63bacfa418 100644 --- a/layouts/partials/stylesheet.html +++ b/layouts/partials/stylesheet.html @@ -1,4 +1,9 @@ - {{- $outputFormat := partial "output-format.hugo" . }} + {{- $outputFormat := "html" }} + {{- with .Store.Get "relearnOutputFormat" }} + {{- $outputFormat = . }} + {{- else }} + {{- warnf "WARNING no key `relearnOutputFormat` found in page store, set one by providing the file `layouts/_default/view/storeOutputFormat..html` for your self-defined output format; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#600" }} + {{- end }} {{- $assetBusting := partialCached "assetbusting.hugo" . }} {{- /* https://github.com/filamentgroup/loadCSS/blob/master/README.md#how-to-use */}} diff --git a/layouts/partials/term-list.html b/layouts/partials/term-list.html index 9abe9fe22a..ce2d3406a9 100644 --- a/layouts/partials/term-list.html +++ b/layouts/partials/term-list.html @@ -18,7 +18,7 @@ {{- end }} {{- $taxonomy_title := partial "pageHelper/title.hugo" (dict "page" $taxonomy_page) }} {{- with $term_pages }} -
+
{{- if $icon }} {{- end }} diff --git a/static/css/theme.css b/static/css/theme.css index 94e0de8710..ffb769fb96 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -324,16 +324,16 @@ dd { margin: 1.5rem 1rem 1rem 1rem; } -.tags{ +article .R-taxonomy.tags { margin-left: 1rem; margin-top: 1rem; } -.tags.term-list ul > li ~ li:before { +article .R-taxonomy.tags ul > li ~ li:before { content: " " } -#R-body .tags a.term-link { +article .R-taxonomy.tags a.term-link { border-bottom-right-radius: 3px; border-top-right-radius: 3px; box-shadow: 0 1px 2px rgba( 0, 0, 0, .2 ); @@ -347,7 +347,7 @@ dd { position: relative; } -#R-body .tags a.term-link:before { +article .R-taxonomy.tags a.term-link:before { border-color: transparent; border-style: solid; border-width: 1em 1em 1em 0; @@ -359,7 +359,7 @@ dd { width: 0; } -#R-body .tags a.term-link:after { +article .R-taxonomy.tags a.term-link:after { border-radius: 100%; content: ""; left: 1px; @@ -369,7 +369,7 @@ dd { width: 5px; } -#R-body .tags a.term-link:hover:after { +article .R-taxonomy.tags a.term-link:hover:after { width: 5px; } @@ -526,52 +526,51 @@ article a:focus > img:only-child:empty{ max-width: calc( var(--INTERNAL-MAIN-WIDTH-MAX) - var(--INTERNAL-MENU-WIDTH-L) - 2 * 3.25rem ); width: 100%; } -body:not(.print) #R-body .narrow .flex-block-wrapper { +body:not(.print) #R-body .flex-block-wrapper:has(> article.narrow ) { max-width: calc( var(--INTERNAL-MAIN-WIDTH-MAX) - var(--INTERNAL-MENU-WIDTH-L) - 2 * 9.75rem ); } /* we limit width if we have large screens */ body.main-width-max #R-body .flex-block-wrapper { width: calc( var(--INTERNAL-MAIN-WIDTH-MAX) - var(--INTERNAL-MENU-WIDTH-L) - 2 * 3.25rem ); } -body.main-width-max:not(.print) #R-body .narrow .flex-block-wrapper { +body.main-width-max:not(.print) #R-body .flex-block-wrapper:has(> article.narrow ) { width: calc( var(--INTERNAL-MAIN-WIDTH-MAX) - var(--INTERNAL-MENU-WIDTH-L) - 2 * 9.75rem ); } -body:not(.print) #R-body-inner.narrow { +body:not(.print) #R-body-inner:has(> .flex-block-wrapper > article.narrow ) { padding: 0 9.75rem 2rem 9.75rem; } @media screen and (max-width: 59.999rem) { - body:not(.print) #R-body-inner.narrow { + body:not(.print) #R-body-inner:has(> .flex-block-wrapper > article.narrow ) { padding: 0 6.5rem 1rem 6.5rem; } } @media screen and (max-width: 47.999rem) { - body:not(.print) #R-body-inner.narrow { + body:not(.print) #R-body-inner:has(> .flex-block-wrapper > article.narrow ) { padding: 0 3.25rem .375rem 3.25rem; } } -#R-body-inner div.article-subheading, -#R-body-inner .chapter.deprecated h3:first-of-type { +#R-body-inner > .flex-block-wrapper > article > .article-subheading { font-weight: 200; margin-top: 0; text-align: center; } -body:not(.print) #R-body-inner.narrow div.article-subheading{ +body:not(.print) #R-body-inner > .flex-block-wrapper > article.narrow > .article-subheading { margin-top: 2rem; } @media screen and (max-width: 59.999rem) { - body:not(.print) #R-body-inner.narrow div.article-subheading{ + body:not(.print) #R-body-inner > .flex-block-wrapper > article.narrow > .article-subheading { margin-top: 1rem; } } @media screen and (max-width: 47.999rem) { - body:not(.print) #R-body-inner.narrow div.article-subheading{ + body:not(.print) #R-body-inner > .flex-block-wrapper > article.narrow > .article-subheading { margin-top: .375rem; } } -body:not(.print) #R-body-inner.narrow p { +body:not(.print) #R-body-inner > .flex-block-wrapper > article.narrow p { font-size: 1.2rem; text-align: justify; } @@ -618,17 +617,17 @@ h1 { text-transform: uppercase; } -body:not(.print) #R-body-inner.narrow h1 { +body:not(.print) #R-body-inner > .flex-block-wrapper > article.narrow h1 { border-bottom: 4px solid rgba( 134, 134, 134, .125 ); font-size: 3.5rem; } @media only screen and (min-width: 48rem) and (max-width: 59.999rem) { - body:not(.print) #R-body-inner.narrow h1 { + body:not(.print) #R-body-inner > .flex-block-wrapper > article.narrow h1 { font-size: 2.8rem; } } @media only screen and (max-width: 47.999rem) { - body:not(.print) #R-body-inner.narrow h1 { + body:not(.print) #R-body-inner > .flex-block-wrapper > article.narrow h1 { font-size: 2.5rem; } } @@ -2382,16 +2381,16 @@ html[dir="rtl"] #R-sidebar ul.collapsible-menu > li > label > i.fa-chevron-right padding-top: 1rem; } -.term-list ul, -.term-list li { +article .R-taxonomy ul, +article .R-taxonomy li { list-style: none; display: inline; padding: 0; } -.term-list i ~ ul > li:before{ +article .R-taxonomy i ~ ul > li:before{ content: " " } -.term-list ul > li ~ li:before { +article .R-taxonomy ul > li ~ li:before { content: " | " }