theme: switch partialCached key to .Path #685

This commit is contained in:
Sören Weber 2024-08-29 23:50:31 +02:00
parent 4adf99061b
commit d4cbccdde0
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
13 changed files with 17 additions and 17 deletions

View file

@ -1,4 +1,4 @@
{{- partialCached "relearn-meta.gotmpl" . .RelPermalink }}
{{- partialCached "relearn-meta.gotmpl" . .Path }}
{{- $pages := slice }}
{{- range .Site.Pages }}
{{- if partial "_relearn/pageIsSpecial.gotmpl" . }}

View file

@ -1,4 +1,4 @@
{{- partialCached "relearn-meta.gotmpl" . .RelPermalink }}
{{- partialCached "relearn-meta.gotmpl" . .Path }}
{{- .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">

View file

@ -1,4 +1,4 @@
{{- partialCached "relearn-meta.gotmpl" . .RelPermalink -}}
{{- partialCached "relearn-meta.gotmpl" . .Path -}}
<!DOCTYPE html>
{{- block "storeOutputFormat" . }}{{ end }}
{{- if eq . .Site.Sites.First.Home }}

View file

@ -1,5 +1,5 @@
{{- /* based on Hugo 0.125.5 rss.xml */}}
{{- partialCached "relearn-meta.gotmpl" . .RelPermalink }}
{{- partialCached "relearn-meta.gotmpl" . .Path }}
{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}}
{{- $authorEmail := "" }}
{{- if and .Site.Params.author (reflect.IsMap .Site.Params.author) .Site.Params.author.email }}

View file

@ -1,5 +1,5 @@
{{- /* based on Hugo 0.125.5 sitemap.xml */}}
{{- partialCached "relearn-meta.gotmpl" . .RelPermalink }}
{{- partialCached "relearn-meta.gotmpl" . .Path }}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{- range where .Pages "Sitemap.Disable" "ne" true }}

View file

@ -7,7 +7,7 @@
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
{{- .Content }}
{{- $lastCapital := "" }}
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . . }}
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . .Path }}
{{- range $pages }}
{{- $capital := substr .Title 0 1 | upper }}
{{- if ne $lastCapital $capital }}

View file

@ -7,7 +7,7 @@
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
{{- .Content }}
{{- $lastCapital := "" }}
{{- $pages := partialCached "partials/_relearn/pagesTerm.gotmpl" . . }}
{{- $pages := partialCached "partials/_relearn/pagesTerm.gotmpl" . .Path }}
{{- range $pages }}
{{- $capital := substr .Title 0 1 | upper }}
{{- if ne $lastCapital $capital }}

View file

@ -6,7 +6,7 @@
{{- with .sect }}
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
{{- $pages := partial "_relearn/pages.gotmpl" (dict "page" .) }}
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" .) .Path }}
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
{{- if $hidden }}
@ -29,7 +29,7 @@
{{- $currentNode := .currentnode }}
{{- with .sect }}
{{- $page := . }}
{{- partialCached "_relearn/nestedContent.gotmpl" $page $page.RelPermalink }}
{{- partialCached "_relearn/nestedContent.gotmpl" $page $page.Path }}
{{- range $page.Site.Params.relearn.dependencies }}
{{- $has := printf "has%s" .name }}
{{- $hasnested := printf "relearnHasNested%s" .name }}

View file

@ -23,7 +23,7 @@
<div id="R-content-wrapper" class="highlightable">
<div id="R-topics">
<ul class="enlarge morespace collapsible-menu">
{{- $pages := partial "_relearn/pages.gotmpl" (dict "page" .Site.Home) }}
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" .Site.Home) .Site.Home.Path }}
{{- $defaultAlwaysopen := .Site.Params.alwaysopen | default false }}
{{- range $pages }}
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen }}
@ -122,7 +122,7 @@
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
{{- $isActive := $isSelf }}
{{- $pages := partial "_relearn/pages.gotmpl" (dict "page" .) }}
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" .) .Path }}
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
{{- if $hidden }}

View file

@ -65,7 +65,7 @@ section: {{- .Section }}
{{- end }}
{{- end }}
{{- $pages := partial "_relearn/pages.gotmpl" (dict "page" .node) }}
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" .node) .node.Path }}
{{- range $pages }}
{{- template "relearn-structure" dict "node" . "currentnode" $currentNode "hiddenstem" $hidden_stem "hiddencurrent" $hidden_from_current }}
{{- end }}

View file

@ -2,9 +2,9 @@
{{- $lastCapital := "" }}
{{- $pages := slice }}
{{- if eq .Kind "taxonomy" }}
{{- $pages = partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . . }}
{{- $pages = partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . .Path }}
{{- else if eq .Kind "term" }}
{{- $pages = partialCached "partials/_relearn/pagesTerm.gotmpl" . . }}
{{- $pages = partialCached "partials/_relearn/pagesTerm.gotmpl" . .Path }}
{{- end }}
{{- $toc_pages := "" }}
{{- range $pages }}

View file

@ -12,11 +12,11 @@
{{- if eq .Page.Kind "term" }}
{{- /* go to next term page */}}
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" $taxonomy_page $taxonomy_page }}
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" $taxonomy_page $taxonomy_page.Path }}
{{- $next = partial "partials/_relearn/pageNext.gotmpl" (dict "collection" $pages "item" .) }}
{{- else if eq .Page.Kind "taxonomy" }}
{{- /* go to first term page */}}
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . . }}
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . .Path }}
{{- $next = (index $pages 0).Page }}
{{- end }}
{{- $nextTitle := partial "title.gotmpl" (dict "page" $next "outputFormat" "html") }}

View file

@ -12,7 +12,7 @@
{{- if eq .Page.Kind "term" }}
{{- /* go to previous term page or taxonomy page if it is the first term */}}
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" $taxonomy_page $taxonomy_page }}
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" $taxonomy_page $taxonomy_page.Path }}
{{- $prev = partial "partials/_relearn/pagePrev.gotmpl" (dict "collection" $pages "item" .) | default $taxonomy_page }}
{{- else if eq .Page.Kind "taxonomy" }}
{{- $prev = .Site.Home }}