mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 02:40:24 +00:00
theme: switch partialCached key to .Path #685
This commit is contained in:
parent
4adf99061b
commit
d4cbccdde0
13 changed files with 17 additions and 17 deletions
|
@ -1,4 +1,4 @@
|
|||
{{- partialCached "relearn-meta.gotmpl" . .RelPermalink }}
|
||||
{{- partialCached "relearn-meta.gotmpl" . .Path }}
|
||||
{{- $pages := slice }}
|
||||
{{- range .Site.Pages }}
|
||||
{{- if partial "_relearn/pageIsSpecial.gotmpl" . }}
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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") }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue