theme: replace output-partial by Hugo mechanisms #891

This commit is contained in:
Sören Weber 2024-08-29 00:32:21 +02:00
parent a467f6f087
commit e95d057776
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
65 changed files with 222 additions and 345 deletions

View file

@ -1,6 +1,6 @@
+++
archetype = "chapter"
title = "{{ replace .Name "-" " " | title }}"
type = "chapter"
weight = 1
+++

View file

@ -1,6 +1,6 @@
+++
archetype = "home"
title = "{{ replace .Name "-" " " | title }}"
type = "home"
+++
This is a new home page.

View file

@ -137,7 +137,7 @@ h1 + .footline{
#R-body .topbar-sidebar-divider {
border-width: 0;
}
.term-list {
article .R-taxonomy {
display: none;
}
mark.search {

View file

@ -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);
}

View file

@ -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" >}}

View file

@ -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 >}}

View file

@ -1,6 +1,6 @@
+++
archetype = "chapter"
title = "Basics"
type = "chapter"
weight = 1
+++

View file

@ -1,6 +1,6 @@
+++
archetype = "chapter"
title = "Basics"
type = "chapter"
weight = 1
+++
{{< piratify >}}

View file

@ -1,6 +1,6 @@
+++
archetype = "chapter"
title = "Content"
type = "chapter"
weight = 2
+++

View file

@ -1,6 +1,6 @@
+++
archetype = "chapter"
title = "Rambl'n"
type = "chapter"
weight = 2
+++
{{< piratify >}}

View file

@ -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/<kind>.md` and make sure i
````toml {title="&lt;kind&gt;.md"}
+++
archetype = "<kind>"
type = "<kind>"
+++
````

View file

@ -1,7 +1,7 @@
+++
archetype = "chapter"
hidden = true
title = "Development"
type = "chapter"
weight = 4
+++

View file

@ -1,7 +1,7 @@
+++
archetype = "chapter"
hidden = true
title = "Development"
type = "chapter"
weight = 4
+++
{{< piratify >}}

View file

@ -1,7 +1,7 @@
+++
archetype = "chapter"
title = "Shortcodes"
ordersectionsby = "title"
title = "Shortcodes"
type = "chapter"
weight = 3
+++

View file

@ -1,7 +1,7 @@
+++
archetype = "chapter"
title = "Shorrrtcodes"
ordersectionsby = "title"
title = "Shorrrtcodes"
type = "chapter"
weight = 3
+++
{{< piratify >}}

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -7,4 +7,4 @@ title: "page X"
weight: 1
---
This is a plain demo child page.
This is a plain demo child page X.

View file

@ -1 +1 @@
{{ if (eq .Params.archetype "chapter") }}<b style="display: inline-block; font-weight: 200; padding-left: .3rem; text-align: left; width: 1.1rem;">{{ .Params.weight }}.</b> {{ end }}
{{ if (eq .Type "chapter") }}<b style="display: inline-block; font-weight: 200; padding-left: .3rem; text-align: left; width: 1.1rem;">{{ .Params.weight }}.</b> {{ end }}

View file

@ -1,18 +1,22 @@
<!DOCTYPE html>
{{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- .Store.Set "relearnOutputFormat" "notfound" -}}
<!DOCTYPE html>
<html lang="{{ .Page.Language.LanguageCode }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}" itemscope itemtype="http://schema.org/Article">
<head>
{{- partial "meta.html" . }}
{{- $title := partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) }}
<title>{{ $title }}</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 */}}
<base href="{{ .Site.BaseURL }}">
{{- partialCached "favicon.html" . }}
{{- partial "stylesheet.html" . }}
{{- partial "custom-header.html" . }}
</head>
<body class="mobile-support html notfound" data-url="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">
<body class="mobile-support {{ with .Store.Get "relearnOutputFormat" }}{{ . }}{{ else }}html{{ end }}" data-url="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">
<div id="R-body" class="default-animation">
<main id="R-body-inner" class="chapter" tabindex="-1">
<main id="R-body-inner" class="highlightable chapter" tabindex="-1">
<div class="flex-block-wrapper">
<article>
<h1 id="404"><span>4</span>{{ partial "shortcodes/icon.html" (dict "page" . "icon" "far fa-frown" )}}<span>4</span></h1>

View file

@ -1,5 +1,6 @@
{{- partialCached "page-meta.hugo" . .RelPermalink -}}
<!DOCTYPE html>
{{- $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 @@
<html lang="{{ .Page.Language.LanguageCode }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}" itemscope itemtype="http://schema.org/Article">
<head>
{{- partial "meta.html" . }}
{{- $page := . }}
{{- $link := "<link href=\"%s\" rel=\"%s\" type=\"%s\" title=\"%s\">" }}
{{- $title := partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) }}
<title>{{ $title }}</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 := "<link href=\"%s\" rel=\"%s\" type=\"%s\" title=\"%s\">" }}
{{- 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" . }}
</head>
<body class="mobile-support {{ $outputFormat }}{{- if .Site.Params.disableInlineCopyToClipBoard }} disableInlineCopyToClipboard{{ end }}{{- if .Site.Params.disableHoverBlockCopyToClipBoard }} disableHoverBlockCopyToClipBoard{{ end }}" data-url="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">
<body class="mobile-support {{ with .Store.Get "relearnOutputFormat" }}{{ . }}{{ else }}html{{ end }}{{- if .Site.Params.disableInlineCopyToClipBoard }} disableInlineCopyToClipboard{{ end }}{{- if .Site.Params.disableHoverBlockCopyToClipBoard }} disableHoverBlockCopyToClipBoard{{ end }}" data-url="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">
<div id="R-body" class="default-animation">
<div id="R-body-overlay"></div>
<nav id="R-topbar">
@ -58,7 +60,7 @@
</ol>
{{- else }}
<span class="topbar-breadcrumbs highlightable">
{{ .Title }}
{{ partial "pageHelper/title.hugo" (dict "page" . "linkTitle" true) }}
</span>
{{- end }}
<div class="topbar-area topbar-area-end" data-area="end">
@ -66,7 +68,20 @@
</div>
</div>
</nav>
{{- $hook := "styleclass" }}
<div id="R-main-overlay"></div>
<main id="R-body-inner" class="highlightable {{ partialCached "archetype.hugo" (dict "hook" $hook "page" . "parameter" .) .RelPermalink $hook }}" tabindex="-1">
<main id="R-body-inner" class="highlightable{{ with or .Type "default" }} {{ . }}{{ end }}" tabindex="-1">
<div class="flex-block-wrapper">
{{- block "body" . }}{{ end }}
</div>
</main>
{{- partial "custom-comments.html" . }}
</div>
{{- block "menu" . }}{{ end }}
{{- $assetBusting := partialCached "assetbusting.hugo" . }}
<script src="{{"js/clipboard.min.js" | relURL}}{{ $assetBusting }}" defer></script>
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ $assetBusting }}" defer></script>
{{- partial "dependencies.html" (dict "page" . "location" "footer") }}
<script src="{{"js/theme.js" | relURL}}{{ $assetBusting }}" defer></script>
{{- partial "custom-footer.html" . }}
</body>
</html>

View file

@ -1 +0,0 @@
{{- partial "_main.hugo" . }}

View file

@ -1 +1,9 @@
{{- partial "_main.hugo" . }}
{{- define "storeOutputFormat" }}
{{- .Render "views/storeOutputFormat" }}
{{- end }}
{{- define "body" }}
{{- .Render "views/page" }}
{{- end }}
{{- define "menu" }}
{{- .Render "views/menu" }}
{{- end }}

View file

@ -1 +1,9 @@
{{- partial "_main.hugo" . }}
{{- define "storeOutputFormat" }}
{{- .Render "views/storeOutputFormat" }}
{{- end }}
{{- define "body" }}
{{- .Render "views/page" }}
{{- end }}
{{- define "menu" }}
{{- .Render "views/menu" }}
{{- end }}

View file

@ -1,33 +1,9 @@
{{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- partial "header.html" . }}
<article>
<header class="headline">
</header>
{{- $page := . }}
{{- $title := partial "pageHelper/title.hugo" (dict "page" .) }}
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
{{- .Content }}
{{- $lastCapital := "" }}
{{- $pages := partialCached "partials/pageHelper/taxonomyPages.html" . . }}
{{- range $pages }}
{{- $capital := substr .Title 0 1 | upper }}
{{- if ne $lastCapital $capital }}
{{- if ne $lastCapital "" }}
</ul>
{{- end }}
<h2 id="{{ $capital | plainify | anchorize }}">{{ $capital }}</h2>
<ul class="columnize">
{{- end }}
{{- /* display terms of a taxonomy */}}
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Title }}</a> ({{ .Count }})</li>
{{- $lastCapital = $capital }}
{{- define "storeOutputFormat" }}
{{- .Render "views/storeOutputFormat" }}
{{- end }}
{{- if ne $lastCapital "" }}
</ul>
{{- define "body" }}
{{- partial "bodys/taxonomy.html" . }}
{{- end }}
{{- define "menu" }}
{{- .Render "views/menu" }}
{{- end }}
<footer class="footline">
</footer>
</article>
{{- partial "footer.html" . }}

View file

@ -1,37 +1,9 @@
{{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- partial "header.html" . }}
<article>
<header class="headline">
</header>
{{- $page := . }}
{{- $title := partial "pageHelper/title.hugo" (dict "page" .) }}
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
{{- .Content }}
{{- $lastCapital := "" }}
{{- $pages := partialCached "partials/pageHelper/termPages.html" . . }}
{{- range $pages }}
{{- $capital := substr .Title 0 1 | upper }}
{{- if ne $lastCapital $capital }}
{{- if ne $lastCapital "" }}
</ul>
{{- end }}
<h2 id="{{ $capital | plainify | anchorize }}">{{ $capital }}</h2>
<ul class="columnize">
{{- 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 }}
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Title }}</a>{{ with $breadcrumb }}<div class="breadcrumbs highlightable" title="{{ . }}">{{ . }}</div>{{ end }}</li>
{{- $lastCapital = $capital }}
{{- define "storeOutputFormat" }}
{{- .Render "views/storeOutputFormat" }}
{{- end }}
{{- if ne $lastCapital "" }}
</ul>
{{- define "body" }}
{{- partial "bodys/term.html" . }}
{{- end }}
{{- define "menu" }}
{{- .Render "views/menu" }}
{{- end }}
<footer class="footline">
</footer>
</article>
{{- partial "footer.html" . }}

View file

@ -1,15 +1,12 @@
{{- $page := .page }}
{{- $content := .content }}
{{- with $page }}
<article class="default">
<header class="headline">
{{- partial "content-header.html" . }}
</header>
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
{{ $content | safeHTML }}
{{ partial "content.html" . | safeHTML }}
<footer class="footline">
{{- partial "content-footer.html" . }}
</footer>
</article>
{{- end }}

View file

@ -0,0 +1 @@
{{- partial "menu.html" . }}

View file

@ -0,0 +1 @@
{{- partial "bodys/page-single.html" . }}

View file

@ -0,0 +1 @@
{{- partial "bodys/page-tree.html" . }}

View file

@ -0,0 +1 @@
{{- .Store.Set "relearnOutputFormat" "html" }}

View file

@ -0,0 +1 @@
{{- .Store.Set "relearnOutputFormat" "print" }}

View file

@ -1,16 +1,13 @@
{{- $page := .page }}
{{- $content := .content }}
{{- with $page }}
<article class="chapter">
<article class="chapter narrow">
<header class="headline">
{{- partial "content-header.html" . }}
</header>
{{ partial "heading-pre.html" . }}<div class="article-subheading">{{ T "Chapter" .Params.Weight }}</div>
{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
{{ $content | safeHTML }}
{{ partial "content.html" . | safeHTML }}
<footer class="footline">
{{- partial "content-footer.html" . }}
</footer>
</article>
{{- end }}

View file

@ -1,15 +1,12 @@
{{- $page := .page }}
{{- $content := .content }}
{{- with $page }}
<article class="home">
<header class="headline">
{{- partial "content-header.html" . }}
</header>
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
{{ $content | safeHTML }}
{{ partial "content.html" . | safeHTML }}
<footer class="footline">
{{- partial "content-footer.html" . }}
</footer>
</article>
{{- end }}

View file

@ -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" .) }}

View file

@ -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)<h1.*?>.*?</h1>` .Content }}
{{- $archetype = "deprecated-chapter" }}
{{- end }}
{{- else if $page.IsHome }}
{{- $archetype = "home" }}
{{- if findRE `(?s)<h1.*?>.*?</h1>` .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) }}

View file

@ -1 +0,0 @@
chapter narrow

View file

@ -1 +0,0 @@
default

View file

@ -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 }}
<article class="chapter deprecated">
<header class="headline">
{{- partial "content-header.html" . }}
</header>
{{ $content | safeHTML }}
<footer class="footline">
{{- partial "content-footer.html" . }}
</footer>
</article>
{{- end }}

View file

@ -1 +0,0 @@
chapter narrow

View file

@ -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 }}
<article class="home deprecated">
<header class="headline">
{{- partial "content-header.html" . }}
</header>
{{ $content | safeHTML }}
<footer class="footline">
{{- partial "content-footer.html" . }}
</footer>
</article>
{{- end }}

View file

@ -1 +0,0 @@
home

View file

@ -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 }}

View file

@ -1,3 +0,0 @@
{{- $page := .page }}
{{- $content := .content }}
{{- partial "single-article.hugo" (dict "page" $page "content" $content) }}

View file

@ -1,3 +0,0 @@
{{- $page := .page }}
{{- $content := .content }}
{{- partial "nested-article.hugo" (dict "page" $page) }}

View file

@ -0,0 +1,2 @@
{{- .Store.Set "relearnIsNested" false }}
{{- .Render "views/article" }}

View file

@ -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,7 +29,7 @@
{{- $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 }}

View file

@ -0,0 +1,30 @@
<article>
<header class="headline">
</header>
{{- $title := partial "pageHelper/title.hugo" (dict "page" .) }}
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
{{- .Content }}
{{- $lastCapital := "" }}
{{- $pages := partialCached "partials/pageHelper/taxonomyPages.html" . . }}
{{- range $pages }}
{{- $capital := substr .Title 0 1 | upper }}
{{- if ne $lastCapital $capital }}
{{- if ne $lastCapital "" }}
</ul>
{{- end }}
<h2 id="{{ $capital | plainify | anchorize }}">{{ $capital }}</h2>
<ul class="columnize">
{{- end }}
{{- /* display terms of a taxonomy */}}
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Title }}</a> ({{ .Count }})</li>
{{- $lastCapital = $capital }}
{{- end }}
{{- if ne $lastCapital "" }}
</ul>
{{- end }}
<footer class="footline">
</footer>
</article>

View file

@ -0,0 +1,34 @@
<article>
<header class="headline">
</header>
{{- $title := partial "pageHelper/title.hugo" (dict "page" .) }}
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
{{- .Content }}
{{- $lastCapital := "" }}
{{- $pages := partialCached "partials/pageHelper/termPages.html" . . }}
{{- range $pages }}
{{- $capital := substr .Title 0 1 | upper }}
{{- if ne $lastCapital $capital }}
{{- if ne $lastCapital "" }}
</ul>
{{- end }}
<h2 id="{{ $capital | plainify | anchorize }}">{{ $capital }}</h2>
<ul class="columnize">
{{- 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 }}
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Title }}</a>{{ with $breadcrumb }}<div class="breadcrumbs highlightable" title="{{ . }}">{{ . }}</div>{{ end }}</li>
{{- $lastCapital = $capital }}
{{- end }}
{{- if ne $lastCapital "" }}
</ul>
{{- end }}
<footer class="footline">
</footer>
</article>

View file

@ -1 +1,4 @@
{{- .Content }}
{{- /* 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 }}

View file

@ -1,13 +0,0 @@
</div>
</main><!-- #R-body-inner -->
{{- partial "custom-comments.html" . }}
</div><!-- #R-body -->
{{- partial "output-partial.hugo" (dict "base" "menu" "page" . "parameter" .) }}
{{- $assetBusting := partialCached "assetbusting.hugo" . }}
<script src="{{"js/clipboard.min.js" | relURL}}{{ $assetBusting }}" defer></script>
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ $assetBusting }}" defer></script>
{{- partial "dependencies.html" (dict "page" . "location" "footer") }}
<script src="{{"js/theme.js" | relURL}}{{ $assetBusting }}" defer></script>
{{- partial "custom-footer.html" . }}
</body>
</html>

View file

@ -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 }}

View file

@ -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 }}

View file

@ -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 }}

View file

@ -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 }}

View file

@ -1,8 +0,0 @@
{{- $format := partial "get-format.hugo" . }}
{{- $ret := "html" }}
{{- if $format }}
{{- range first 1 $format.MediaType.Suffixes }}
{{- $ret = . }}
{{- end }}
{{- end }}
{{- return $ret }}

View file

@ -1,3 +1,13 @@
<!--
@@@
lang: {{- .Site.LanguagePrefix }}
path: {{- .Path }}
kind: {{- .Kind }} ["home" "page" "section" "taxonomy" "term"]
layout: {{- .Layout }}
type: {{- .Type }} [frontmatter:type section "page"]
section: {{- .Section }}
@@@
-->
{{- $currentNode := . }}
{{- $forceContent := $currentNode.WordCount }}
{{- $currentNode.Scratch.Delete "relearnIsSelfFound" }}

View file

@ -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)) }}

View file

@ -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.<MYOUTPUTFORMAT>.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 */}}
<link href="{{"css/fontawesome-all.min.css" | relURL}}{{ $assetBusting }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="{{"css/fontawesome-all.min.css" | relURL}}{{ $assetBusting }}" rel="stylesheet"></noscript>

View file

@ -18,7 +18,7 @@
{{- end }}
{{- $taxonomy_title := partial "pageHelper/title.hugo" (dict "page" $taxonomy_page) }}
{{- with $term_pages }}
<div class=" taxonomy-{{ $taxonomy }} term-list cstyle {{ $style }} {{ $class }}" title="{{ $taxonomy_title }}"{{ if $color }}{{ printf " style=\"--VARIABLE-TAGS-BG-color: %s;\"" $color | safeHTMLAttr }}{{ end }}>
<div class="R-taxonomy taxonomy-{{ $taxonomy }} cstyle{{ with $style }} {{ . }}{{ end }}{{ with $class }} {{ . }}{{ end }}" title="{{ $taxonomy_title }}"{{ if $color }}{{ printf " style=\"--VARIABLE-TAGS-BG-color: %s;\"" $color | safeHTMLAttr }}{{ end }}>
{{- if $icon }}
<i class="{{ $icon }}"></i>
{{- end }}

View file

@ -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: " | "
}