diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 2998400e1d..ad7aa4ac4e 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -42,8 +42,14 @@ {{ printf "" ( partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true)) .MediaType | safeHTML }} {{- end }} {{- range $pages }} + {{- $visible := true }} {{- $relearnIsHiddenFrom := index ($page.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} - {{- if and .Permalink .Title (or (not $relearnIsHiddenFrom) (ne .Site.Params.disableSeoHiddenPages true) ) }} + {{- if or (eq .Kind "taxonomy") (eq .Kind "term") }} + {{- $visible = and .Title .Permalink (or (not $relearnIsHiddenFrom) (ne .Site.Params.disableTagHiddenPages true) ) }} + {{- else }} + {{- $visible = and .Title .Permalink (or (not $relearnIsHiddenFrom) (ne .Site.Params.disableSeoHiddenPages true) ) }} + {{- end }} + {{- if $visible }} {{ partial "pageHelper/title.hugo" (dict "page" . "format" $format "outputFormat" $outputFormat) }} {{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index f27f900a6a..ff6b1f8a34 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -31,7 +31,7 @@ {{- end }} {{- end }} - {{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }} + {{- if not (and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }} {{- else }} {{- range .AlternativeOutputFormats }} {{- if eq .Rel "canonical" }} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index be4c716ab7..5adc8e5d40 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -143,10 +143,10 @@ {{- $subHidden := and $relearnIsSubHiddenFrom (not $.showhidden) (not $isSelfSub) (not $isAncestorSub) }} {{- $numberOfVisibleChildren = add $numberOfVisibleChildren (int (not $subHidden)) }} {{- end }} + {{- $title := partial "pageHelper/title.hugo" (dict "page" . "linkTitle" true) }} + {{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }} {{- safeHTML .Params.head }} {{- if $numberOfVisibleChildren }} - {{- $title := or .LinkTitle .Title }} - {{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }} {{- $isCollapsible := or (.Params.collapsibleMenu | default .Site.Params.collapsibleMenu) (not $url) }} {{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }} {{- $pageHash := md5 .Page }} @@ -159,8 +159,6 @@ {{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen }} {{- end }} {{- else }} - {{- $title := or .LinkTitle .Title }} - {{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
  • {{ if $url }}{{ else }}{{ end }} {{- partial "menu-pre.html" . }}{{ $title }}{{ partial "menu-post.html" . }} {{- if $url }}{{ if $showvisitedlinks }}{{ end }}{{ else }}{{ end }}
  • diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index fa676eb136..937b6ad79f 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -10,7 +10,7 @@ {{- $ver := printf "" "Relearn" $ver }} {{ $ver | safeHTML }} {{- end }} - {{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }} + {{- if not (and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }} {{- end }} diff --git a/layouts/partials/page-meta.hugo b/layouts/partials/page-meta.hugo index ea157ef321..e72ecb2ee2 100644 --- a/layouts/partials/page-meta.hugo +++ b/layouts/partials/page-meta.hugo @@ -14,8 +14,13 @@ {{- $currentNode.Store.Set $has true }} {{- end }} {{- end }} - {{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false }} +{{- if not ($currentNode.Scratch.Get "relearnIsSelfFound") }} + {{- if not $currentNode.IsHome }} + {{- $currentNode.Scratch.Set "relearnPrevPage" .Site.Home }} + {{- end }} +{{- end }} + {{- define "relearn-structure" }} {{- $currentNode := .currentnode }} {{- $isSelf := eq $currentNode .node }} diff --git a/layouts/partials/pageHelper/isHidden.html b/layouts/partials/pageHelper/isHidden.html deleted file mode 100644 index 741399dbc2..0000000000 --- a/layouts/partials/pageHelper/isHidden.html +++ /dev/null @@ -1 +0,0 @@ -{{- return (or (not .Title) .Params.hidden) }} \ No newline at end of file diff --git a/layouts/partials/pageHelper/pagesBy.html b/layouts/partials/pageHelper/pagesBy.html index 734d47a3d2..63fa3e41b5 100644 --- a/layouts/partials/pageHelper/pagesBy.html +++ b/layouts/partials/pageHelper/pagesBy.html @@ -5,7 +5,6 @@ {{- $by = "" }} {{- end }} {{- $by = $by | default $page.Params.ordersectionsby | default $page.Site.Params.ordersectionsby | default "weight" }} -{{- $hidden := .hidden }} {{- $pages := slice }} diff --git a/layouts/partials/pageHelper/title.hugo b/layouts/partials/pageHelper/title.hugo index 8d9a8b8219..143e1df643 100644 --- a/layouts/partials/pageHelper/title.hugo +++ b/layouts/partials/pageHelper/title.hugo @@ -3,18 +3,19 @@ {{- if .Params.menuTitle }} {{- warnf "%q: UNSUPPORTED frontmatter 'menutitle' found, use 'linktitle' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#600" $.File.Filename }} {{- end }} - {{- $format := $.format | default (partial "get-format.hugo" .) }} - {{- $outputFormat := $.outputFormat | default (partial "output-format.hugo" (dict "page" . "format" $format)) }} {{- $siteTitle := site.Title }} {{- $title = .Title }} {{- if $.linkTitle }} - {{- $title = or $.page.LinkTitle $title }} + {{- $title = or .LinkTitle $title }} {{- end }} - {{- if eq $outputFormat "searchpage" }} - {{- $title = T "Search" }} - {{- else if eq .Kind "home" }} - {{- $title = or $title $siteTitle }} + {{- if eq .Kind "home" }} + {{- $title = $title | default $siteTitle }} + {{- $format := $.format | default (partial "get-format.hugo" .) }} + {{- $outputFormat := $.outputFormat | default (partial "output-format.hugo" (dict "page" . "format" $format)) }} + {{- if eq $outputFormat "searchpage" }} + {{- $title = T "Search" }} + {{- end }} {{- else if eq .Kind "taxonomy" }} {{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Params.Title }} {{- else if eq .Kind "term" }} diff --git a/layouts/partials/topbar/button/prev.html b/layouts/partials/topbar/button/prev.html index 3c38ed73fd..27d87136f3 100644 --- a/layouts/partials/topbar/button/prev.html +++ b/layouts/partials/topbar/button/prev.html @@ -10,16 +10,17 @@ {{- if eq (.Language.LanguageDirection | default (T "Reading-direction") | default "ltr") "rtl" }} {{- $startarrow = "🡒" }} {{- end }} - {{- $prev := .Scratch.Get "relearnPrevPage" | default .Site.Home }} + {{- $prev := .Scratch.Get "relearnPrevPage" }} {{- if eq $outputFormat "searchpage" }} {{- $outputFormat = "html" }} - {{- else if eq .Page.Kind "home" }} - {{- $prev = "" }} + {{- $prev = .Site.Home }} {{- else 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/pageHelper/taxonomyPages.html" $taxonomy_page $taxonomy_page }} {{- $prev = partial "partials/pageHelper/prev.html" (dict "collection" $pages "item" .) | default $taxonomy_page }} + {{- else if eq .Page.Kind "taxonomy" }} + {{- $prev = .Site.Home }} {{- end }} {{- $prevTitle := partial "pageHelper/title.hugo" (dict "page" $prev "format" $format "outputFormat" $outputFormat) }} {{- partial "topbar/func/button.html" (dict