mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-04-30 07:02:03 +08:00
theme: fix partial calls for Hugo 0.146.0 #1086
This commit is contained in:
parent
8a07ed3431
commit
523120f28e
@ -10,7 +10,7 @@
|
||||
(.GetPage $path)
|
||||
(.GetPage (strings.TrimRight "/" $path))
|
||||
}}
|
||||
{{ partial "partials/shortcodes/link.html" (dict "page" $page "url" .Path "content" "★ What's new in this version ★") }}
|
||||
{{ partial "shortcodes/link.html" (dict "page" $page "url" .Path "content" "★ What's new in this version ★") }}
|
||||
<hr>
|
||||
{{- end }}
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
(.GetPage $path)
|
||||
(.GetPage (strings.TrimRight "/" $path))
|
||||
}}
|
||||
See the {{ partial "partials/shortcodes/link.html" (dict "page" $page "url" .Path "content" "changelog of this version") }} for a detailed list of changes.
|
||||
See the {{ partial "shortcodes/link.html" (dict "page" $page "url" .Path "content" "changelog of this version") }} for a detailed list of changes.
|
||||
<hr>
|
||||
{{- end }}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
{{- $href = partial "permalink.gotmpl" (dict "to" $of) }}
|
||||
{{- else }}
|
||||
{{- $msg := printf "output format %q not found" $of }}
|
||||
{{- partial "partials/inline/print-error" (dict "url" .url "page" .page "param" .param "msg" $msg "linkObject" .linkObject "hideFilepath" $hideFilepath) }}
|
||||
{{- partial "inline/print-error" (dict "url" .url "page" .page "param" .param "msg" $msg "linkObject" .linkObject "hideFilepath" $hideFilepath) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@ -48,7 +48,7 @@
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $msg := printf "heading ID %q not found" . }}
|
||||
{{- partial "partials/inline/print-error" (dict "url" $.url "page" $.page "param" $.param "msg" $msg "linkObject" $.linkObject "hideFilepath" $.hideFilepath) }}
|
||||
{{- partial "inline/print-error" (dict "url" $.url "page" $.page "param" $.param "msg" $msg "linkObject" $.linkObject "hideFilepath" $.hideFilepath) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
@ -2,11 +2,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.Path }}
|
||||
{{- $pages := partialCached "_relearn/pagesTaxonomy.gotmpl" $taxonomy_page $taxonomy_page.Path }}
|
||||
{{- $next = partial "inline/next-term" (dict "collection" $pages "item" .) }}
|
||||
{{- else if eq .Page.Kind "taxonomy" }}
|
||||
{{- /* go to first term page */}}
|
||||
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . .Path }}
|
||||
{{- $pages := partialCached "_relearn/pagesTaxonomy.gotmpl" . .Path }}
|
||||
{{- with index $pages 0 }}
|
||||
{{- $next = .Page }}
|
||||
{{- end }}
|
||||
|
@ -2,7 +2,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.Path }}
|
||||
{{- $pages := partialCached "_relearn/pagesTaxonomy.gotmpl" $taxonomy_page $taxonomy_page.Path }}
|
||||
{{- $prev = partial "inline/prev-term" (dict "collection" $pages "item" .) | default $taxonomy_page }}
|
||||
{{- else if eq .Page.Kind "taxonomy" }}
|
||||
{{- $prev = .Site.Home }}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
{{- $title := partial "title.gotmpl" (dict "page" .) }}
|
||||
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||
{{ partial "partials/shortcodes/taxonomy.html" (dict "page" . "taxonomy" .) }}
|
||||
{{ partial "shortcodes/taxonomy.html" (dict "page" . "taxonomy" .) }}
|
||||
|
||||
<footer class="footline">
|
||||
</footer>
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
{{- $title := partial "title.gotmpl" (dict "page" .) }}
|
||||
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||
{{ partial "partials/shortcodes/term.html" (dict "page" . "term" .) }}
|
||||
{{ partial "shortcodes/term.html" (dict "page" . "term" .) }}
|
||||
|
||||
<footer class="footline">
|
||||
</footer>
|
||||
|
@ -36,20 +36,20 @@
|
||||
{{- if or (eq (printf "%T" $menuconfigs) "string") (eq (printf "%T" $menuconfigs) "<nil>") }}
|
||||
{{- $menuconfigs = partialCached "_relearn/defaultSidebarHeader.gotmpl" . }}
|
||||
{{- end }}
|
||||
{{- partial "partials/inline/menu" (dict "currentnode" $currentNode "configs" $menuconfigs "showvisitedlinks" false) }}
|
||||
{{- partial "inline/menu" (dict "currentnode" $currentNode "configs" $menuconfigs "showvisitedlinks" false) }}
|
||||
</div>
|
||||
<div id="R-content-wrapper" class="highlightable">
|
||||
{{- $menuconfigs := .Params.sidebarmenus | default site.Params.sidebarmenus }}
|
||||
{{- if or (eq (printf "%T" $menuconfigs) "string") (eq (printf "%T" $menuconfigs) "<nil>") }}
|
||||
{{- $menuconfigs = partialCached "_relearn/defaultSidebar.gotmpl" . }}
|
||||
{{- end }}
|
||||
{{- partial "partials/inline/menu" (dict "currentnode" $currentNode "configs" $menuconfigs "showvisitedlinks" $showvisitedlinks) }}
|
||||
{{- partial "inline/menu" (dict "currentnode" $currentNode "configs" $menuconfigs "showvisitedlinks" $showvisitedlinks) }}
|
||||
<div id="R-footer-margin"></div>
|
||||
{{- $menuconfigs := .Params.sidebarfootermenus | default site.Params.sidebarfootermenus }}
|
||||
{{- if or (eq (printf "%T" $menuconfigs) "string") (eq (printf "%T" $menuconfigs) "<nil>") }}
|
||||
{{- $menuconfigs = partialCached "_relearn/defaultSidebarFooter.gotmpl" . }}
|
||||
{{- end }}
|
||||
{{- partial "partials/inline/menu" (dict "currentnode" $currentNode "configs" $menuconfigs "showvisitedlinks" $showvisitedlinks) }}
|
||||
{{- partial "inline/menu" (dict "currentnode" $currentNode "configs" $menuconfigs "showvisitedlinks" $showvisitedlinks) }}
|
||||
<div id="R-footer">{{ partial "menu-footer.html" . }}</div>
|
||||
</div>
|
||||
</aside>
|
||||
@ -61,13 +61,13 @@
|
||||
{{- range $configs }}
|
||||
{{- $config := . }}
|
||||
{{- if eq $config.type "page" }}
|
||||
{{- partial "partials/inline/page-tree" (dict "currentnode" $currentNode "config" $config "showvisitedlinks" $showvisitedlinks) }}
|
||||
{{- partial "inline/page-tree" (dict "currentnode" $currentNode "config" $config "showvisitedlinks" $showvisitedlinks) }}
|
||||
{{- else if eq $config.type "menu" }}
|
||||
{{- partial "partials/inline/menu-tree" (dict "currentnode" $currentNode "config" $config "showvisitedlinks" $showvisitedlinks "entries" ($config.entries | default (index site.Menus $config.identifier))) }}
|
||||
{{- partial "inline/menu-tree" (dict "currentnode" $currentNode "config" $config "showvisitedlinks" $showvisitedlinks "entries" ($config.entries | default (index site.Menus $config.identifier))) }}
|
||||
{{- else if eq $config.type "custom" }}
|
||||
{{- partial "partials/inline/custom-list" (dict "currentnode" $currentNode "config" $config "elements" $config.elements) }}
|
||||
{{- partial "inline/custom-list" (dict "currentnode" $currentNode "config" $config "elements" $config.elements) }}
|
||||
{{- else if eq $config.type "divider" }}
|
||||
{{- partial "partials/inline/divider" (dict "currentnode" $currentNode "config" $config "elements" $config.elements) }}
|
||||
{{- partial "inline/divider" (dict "currentnode" $currentNode "config" $config "elements" $config.elements) }}
|
||||
{{- else }}
|
||||
{{- warnf "WARNING: unknown menu type '%s' found in parameter 'sidebarmenus' for menu '%s'; use either 'page', 'menu', 'custom' or 'divider'" $config.type $config.identifier }}
|
||||
{{- end }}
|
||||
@ -112,10 +112,10 @@
|
||||
{{- $isSubHidden := or (.Params.hidden) (eq .Title "") }}
|
||||
{{- $isSubCollapsible := .Params.collapsibleMenu | default site.Params.collapsibleMenu }}
|
||||
{{- if or $isSubSelf $isSubAncestor }}
|
||||
{{- partial "partials/inline/page-walker" (dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden) }}
|
||||
{{- partial "inline/page-walker" (dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden) }}
|
||||
{{- else if and (not $isSubHidden) (or $isSubCollapsible (not $entry.RelPermalink) (eq $entry $currentNode) ($entry.IsAncestor $currentNode)) }}
|
||||
{{- $id := md5 .Path }}
|
||||
{{- partialCached "partials/inline/page-walker" (dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden) $id }}
|
||||
{{- partialCached "inline/page-walker" (dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden) $id }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@ -193,10 +193,10 @@
|
||||
{{- $isSubHidden := or (.Params.hidden) (eq .Title "") }}
|
||||
{{- $isSubCollapsible := .Params.collapsibleMenu | default site.Params.collapsibleMenu }}
|
||||
{{- if or $isSubSelf $isSubAncestor }}
|
||||
{{- partial "partials/inline/page-walker" (dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden) }}
|
||||
{{- partial "inline/page-walker" (dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden) }}
|
||||
{{- else if and (not $isSubHidden) (or $isSubCollapsible (not $entry.RelPermalink) (eq $entry $currentNode) ($entry.IsAncestor $currentNode)) }}
|
||||
{{- $id := md5 .Path }}
|
||||
{{- partialCached "partials/inline/page-walker" (dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden) $id }}
|
||||
{{- partialCached "inline/page-walker" (dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden) $id }}
|
||||
{{- end }}
|
||||
{{- end }}</ul></li>
|
||||
{{- else if $url }}
|
||||
@ -268,10 +268,10 @@
|
||||
{{- $isSubHidden := or (.Params.hidden) (eq (partial "_relearn/menuTitle.gotmpl" (dict "page" $currentNode "menu" .)) "") }}
|
||||
{{- $isSubCollapsible := .Params.collapsibleMenu | default $root.Params.collapsibleMenu | default site.Params.collapsibleMenu }}
|
||||
{{- if or $isSubSelf $isSubAncestor }}
|
||||
{{- partial "partials/inline/menu-walker" (dict "menu" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden "root" $root) }}
|
||||
{{- partial "inline/menu-walker" (dict "menu" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden "root" $root) }}
|
||||
{{- else if and (not $isSubHidden) (or $isSubCollapsible (not (partial "_relearn/menuPermalink.gotmpl" (dict "page" $currentNode "menu" $topLevelMenu))) (eq $topLevelObject $currentNode) (and $topLevelMenu ($currentNode.HasMenuCurrent $topLevelMenu.Menu $topLevelMenu))) }}
|
||||
{{- $id := md5 (print .) }}
|
||||
{{- partialCached "partials/inline/menu-walker" (dict "menu" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden "root" $root) $id }}
|
||||
{{- partialCached "inline/menu-walker" (dict "menu" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden "root" $root) $id }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
@ -350,10 +350,10 @@
|
||||
{{- $isSubHidden := or (.Params.hidden) (eq (partial "_relearn/menuTitle.gotmpl" (dict "page" $currentNode "menu" .)) "") }}
|
||||
{{- $isSubCollapsible := .Params.collapsibleMenu | default $root.Params.collapsibleMenu | default site.Params.collapsibleMenu }}
|
||||
{{- if or $isSubSelf $isSubAncestor }}
|
||||
{{- partial "partials/inline/menu-walker" (dict "menu" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden "root" $root) }}
|
||||
{{- partial "inline/menu-walker" (dict "menu" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden "root" $root) }}
|
||||
{{- else if and (not $isSubHidden) (or $isSubCollapsible (not (partial "_relearn/menuPermalink.gotmpl" (dict "page" $currentNode "menu" $entryMenu))) (eq $entryObject $currentNode) ($currentNode.HasMenuCurrent $entryMenu.Menu $entryMenu)) }}
|
||||
{{- $id := md5 (print .) }}
|
||||
{{- partialCached "partials/inline/menu-walker" (dict "menu" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden "root" $root) $id }}
|
||||
{{- partialCached "inline/menu-walker" (dict "menu" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden "root" $root) $id }}
|
||||
{{- end }}
|
||||
{{- end }}</ul></li>
|
||||
{{- else if $url }}
|
||||
|
@ -34,14 +34,14 @@
|
||||
{{- $attributes_figure := $attributes }}
|
||||
{{- $attributes_figure = merge $attributes_figure (dict "class" (delimit ((split $attributes_figure.class " ") | append "figure-image") " ")) }}
|
||||
{{- $attributes_figure = merge $attributes_figure (dict "style" (index $attributes_figure "style")) -}}
|
||||
{{- partial "partials/inline/img" (dict "attributes" $attributes_figure) }}
|
||||
{{- partial "inline/img" (dict "attributes" $attributes_figure) }}
|
||||
{{- if $isLightbox -}}
|
||||
</a>
|
||||
<a href="javascript:history.back();" class="lightbox-back" id="R-image-{{ $id }}">
|
||||
{{- $attributes_lightbox := $attributes }}
|
||||
{{- $attributes_lightbox = merge $attributes_lightbox (dict "class" (delimit ((split $attributes_lightbox.class " ") | append "lightbox-image") " ")) }}
|
||||
{{- $attributes_lightbox = merge $attributes_lightbox (dict "style" "") -}}
|
||||
{{- partial "partials/inline/img" (dict "attributes" $attributes_lightbox) }}</a>
|
||||
{{- partial "inline/img" (dict "attributes" $attributes_lightbox) }}</a>
|
||||
{{- end }}
|
||||
|
||||
{{- define "partials/inline/img" }}
|
||||
|
@ -6,7 +6,7 @@
|
||||
{{- with $taxonomy }}
|
||||
{{- .Content }}
|
||||
{{- $lastCapital := "" }}
|
||||
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . .Path }}
|
||||
{{- $pages := partialCached "_relearn/pagesTaxonomy.gotmpl" . .Path }}
|
||||
{{- range $pages }}
|
||||
{{- $capital := substr .Title 0 1 | upper }}
|
||||
{{- if ne $lastCapital $capital }}
|
||||
|
@ -6,7 +6,7 @@
|
||||
{{- with $term }}
|
||||
{{- .Content }}
|
||||
{{- $lastCapital := "" }}
|
||||
{{- $pages := partialCached "partials/_relearn/pagesTerm.gotmpl" . .Path }}
|
||||
{{- $pages := partialCached "_relearn/pagesTerm.gotmpl" . .Path }}
|
||||
{{- range $pages }}
|
||||
{{- $capital := substr .Title 0 1 | upper }}
|
||||
{{- if ne $lastCapital $capital }}
|
||||
|
@ -2,9 +2,9 @@
|
||||
{{- $lastCapital := "" }}
|
||||
{{- $pages := slice }}
|
||||
{{- if eq .Kind "taxonomy" }}
|
||||
{{- $pages = partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . .Path }}
|
||||
{{- $pages = partialCached "_relearn/pagesTaxonomy.gotmpl" . .Path }}
|
||||
{{- else if eq .Kind "term" }}
|
||||
{{- $pages = partialCached "partials/_relearn/pagesTerm.gotmpl" . .Path }}
|
||||
{{- $pages = partialCached "_relearn/pagesTerm.gotmpl" . .Path }}
|
||||
{{- end }}
|
||||
{{- $toc_pages := "" }}
|
||||
{{- range $pages }}
|
||||
|
@ -1 +1 @@
|
||||
7.6.1+d375e4a5a4e060b8b487b6bafea57e4a66173b66
|
||||
7.6.1+8a07ed3431ac0229008e095e00bae017403248fe
|
Loading…
x
Reference in New Issue
Block a user