diff --git a/layouts/_default/index.search.js b/layouts/_default/index.search.js index 20d2eb296c..6a7291296c 100644 --- a/layouts/_default/index.search.js +++ b/layouts/_default/index.search.js @@ -1,16 +1,14 @@ {{- partialCached "page-meta.hugo" . .RelPermalink }} -{{- $format := partial "get-format.hugo" . }} -{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} {{- $pages := slice }} {{- range .Site.Pages }} {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} {{- $tags := slice }} {{- range .GetTerms "tags" }} - {{- $tags = $tags | append (partial "pageHelper/title.hugo" (dict "page" .Page "linkTitle" true "format" $format "outputFormat" $outputFormat) | plainify) }} + {{- $tags = $tags | append (partial "pageHelper/title.hugo" (dict "page" .Page "linkTitle" true) | plainify) }} {{- end }} {{- $pages = $pages | append (dict "uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .)) - "title" (partial "pageHelper/title.hugo" (dict "page" . "format" $format "outputFormat" $outputFormat) | plainify) + "title" (partial "pageHelper/title.hugo" (dict "page" .) | plainify) "tags" $tags "breadcrumb" (partial "breadcrumbs.html" (dict "page" . "dirOnly" true) | plainify | htmlUnescape | chomp) "description" (or .Description .Summary | plainify | htmlUnescape | chomp) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index ad7aa4ac4e..1a7a24805f 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,7 +1,5 @@ {{- /* based on Hugo 0.125.5 rss.xml */}} {{- partialCached "page-meta.hugo" . .RelPermalink }} -{{- $format := partial "get-format.hugo" . }} -{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} {{- /* 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 }} @@ -29,7 +27,7 @@ {{- printf "" | safeHTML }} - {{ partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true "format" $format "outputFormat" $outputFormat) }} + {{ partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) }} {{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }} {{ or .Description .Summary | plainify | htmlUnescape | chomp | transform.XMLEscape | safeHTML }} Hugo @@ -51,7 +49,7 @@ {{- end }} {{- if $visible }} - {{ partial "pageHelper/title.hugo" (dict "page" . "format" $format "outputFormat" $outputFormat) }} + {{ partial "pageHelper/title.hugo" (dict "page" .) }} {{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }} {{ (or .PublishDate .Date).Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index ff6b1f8a34..384393beba 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -2,8 +2,10 @@ {{- $format := partial "get-format.hugo" . }} {{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} {{- $basename := "index" }} -{{- if eq $outputFormat "searchpage" }} - {{- $basename = partial "BaseName.hugo" $format.RelPermalink }} +{{- if eq .Kind "home" }} + {{- if eq $outputFormat "searchpage" }} + {{- $basename = partial "BaseName.hugo" $format.RelPermalink }} + {{- end }} {{- end }} {{- if eq . .Site.Sites.First.Home }} {{- $hugoVersion := "0.121.0" }} @@ -19,7 +21,7 @@ {{- partial "meta.html" . }} {{- $page := . }} {{- $link := "" }} - {{- $title := partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true "format" $format "outputFormat" $outputFormat) }} + {{- $title := partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) }} {{ $title }} {{- if .IsTranslated -}} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 5adc8e5d40..d2d42fff15 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -1,10 +1,12 @@ {{- $showvisitedlinks := .Site.Params.showVisitedLinks }} - {{- $format := partial "get-format.hugo" . }} - {{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} {{- $basename := "index" }} - {{- if eq $outputFormat "searchpage" }} - {{- $basename = partial "BaseName.hugo" $format.RelPermalink }} + {{- if eq .Kind "home" }} + {{- $format := partial "get-format.hugo" . }} + {{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} + {{- if eq $outputFormat "searchpage" }} + {{- $basename = partial "BaseName.hugo" $format.RelPermalink }} + {{- end }} {{- end }}