diff --git a/assets/_relearn_searchindex.js b/assets/_relearn_searchindex.js index ee709ff98a..05d109a25e 100644 --- a/assets/_relearn_searchindex.js +++ b/assets/_relearn_searchindex.js @@ -1,7 +1,8 @@ {{- partialCached "page-meta.hugo" . .RelPermalink }} {{- $pages := slice }} {{- range .Site.Pages }} - {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} + {{- if partial "pageHelper/isRelearnSpecialPage.html" . }} + {{- else 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) | plainify) }} diff --git a/content/_relearn/searchpage/_content.gotmpl b/content/_relearn/searchpage/_content.gotmpl index 3eb30dc69f..7314b8a169 100644 --- a/content/_relearn/searchpage/_content.gotmpl +++ b/content/_relearn/searchpage/_content.gotmpl @@ -8,6 +8,7 @@ {{- $page := dict "content" $content "kind" "page" + "outputs" (slice "html") "path" "_relearn_searchpage" "title" (T "Search") "url" $url diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 518531e4d1..9de144feef 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -42,7 +42,9 @@ {{- range $pages }} {{- $visible := true }} {{- $relearnIsHiddenFrom := index ($page.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} - {{- if or (eq .Kind "taxonomy") (eq .Kind "term") }} + {{- if partial "pageHelper/isRelearnSpecialPage.html" . }} + {{- $visible = false }} + {{- else 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) ) }} diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index 003043df21..213a9ca081 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -3,7 +3,8 @@ {{- printf "" | safeHTML }} {{- range where .Pages "Sitemap.Disable" "ne" true }} - {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }} + {{- if partial "pageHelper/isRelearnSpecialPage.html" . }} + {{- else if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }} {{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}{{ if not .Lastmod.IsZero }} {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html index 227feb0f85..fe4d1eb52d 100644 --- a/layouts/partials/breadcrumbs.html +++ b/layouts/partials/breadcrumbs.html @@ -14,7 +14,9 @@ {{- $breadcrumb := slice }} {{- range seq $depth }} {{- if $to }} - {{- if or $to.Title (eq $to.Kind "taxonomy") (eq $to.Kind "term") }} + {{- if partial "pageHelper/isRelearnSpecialPage.html" $to }} + {{- break }} + {{- else if or $to.Title (eq $to.Kind "taxonomy") (eq $to.Kind "term") }} {{- $breadcrumb = $breadcrumb | append $to }} {{- end }} {{- else }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 9bf18d0140..bd3e83e003 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -31,7 +31,7 @@ {{- range .AlternativeOutputFormats }} {{- if eq .Rel "canonical" }} {{ (printf $link (partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }} - {{- else }} + {{- else if not (partial "pageHelper/isRelearnSpecialPage.html" $page) }} {{ (printf $link (partial "relLangPrettyUglyURL.hugo" (dict "to" .)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }} {{- end }} {{- end }} diff --git a/layouts/partials/nested-article.hugo b/layouts/partials/nested-article.hugo index b06bea0b37..7a3236987a 100644 --- a/layouts/partials/nested-article.hugo +++ b/layouts/partials/nested-article.hugo @@ -1,20 +1,5 @@ -{{- $page := .page }} -{{- $page.Page.Store.Set "relearnIsNested" true }} -{{- with $page }} - {{- $currentNode := . }} - {{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }} - {{- template "section-print" dict "sect" . "currentnode" $currentNode }} - {{- if $pages }} -
-

{{ T "Subsections" .Title }}

- {{- end }} - {{- range $pages }} - {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode }} - {{- end }} - {{- if $pages }} -
- {{- end }} -{{- end }} +{{- .page.Page.Store.Set "relearnIsNested" true }} +{{- template "section-tree-print" dict "sect" .page "currentnode" .page }} {{- define "section-tree-print" }} {{- $currentNode := .currentnode }} {{- $currentFileRelPermalink := .currentnode.RelPermalink }} diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html index 91301b7968..124ccacb2a 100644 --- a/layouts/partials/opengraph.html +++ b/layouts/partials/opengraph.html @@ -17,7 +17,7 @@ {{- end }} -{{- if .IsPage }} +{{- if and .IsPage (not (partial "pageHelper/isRelearnSpecialPage.html" .)) }} {{- with .FirstSection }} diff --git a/layouts/partials/pageHelper/isRelearnSpecialPage.html b/layouts/partials/pageHelper/isRelearnSpecialPage.html new file mode 100644 index 0000000000..b67e5382f4 --- /dev/null +++ b/layouts/partials/pageHelper/isRelearnSpecialPage.html @@ -0,0 +1,5 @@ +{{- $ret := false }} +{{- if hasPrefix .Path "/_relearn" }} + {{- $ret = true }} +{{- end }} +{{- return $ret }} \ No newline at end of file diff --git a/layouts/partials/pageHelper/pagesBy.html b/layouts/partials/pageHelper/pagesBy.html index 63fa3e41b5..588b63771f 100644 --- a/layouts/partials/pageHelper/pagesBy.html +++ b/layouts/partials/pageHelper/pagesBy.html @@ -31,4 +31,11 @@ {{- $pages = $page.Pages }} {{- end }} -{{- return $pages }} \ No newline at end of file +{{- $filtered_pages := slice }} +{{- range $pages }} + {{- if not (partial "pageHelper/isRelearnSpecialPage.html" .) }} + {{- $filtered_pages = $filtered_pages | append . }} + {{- end }} +{{- end }} + +{{- return $filtered_pages }} \ No newline at end of file diff --git a/layouts/partials/topbar/button/edit.html b/layouts/partials/topbar/button/edit.html index e35895e360..6a9f9bfdcd 100644 --- a/layouts/partials/topbar/button/edit.html +++ b/layouts/partials/topbar/button/edit.html @@ -2,7 +2,11 @@ {{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }} {{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }} {{- with .page }} - {{- if .File }} + {{- $show := .File }} + {{- if $show }} + {{- $show = not (partial "pageHelper/isRelearnSpecialPage.html" .) }} + {{- end }} + {{- if $show }} {{- $filePath := printf "%s%s" (strings.TrimLeft "/" (replace .File.Dir "\\" "/")) .File.LogicalName }} {{- $href := "" }} {{- if .Site.Params.editURL }} diff --git a/layouts/partials/topbar/button/print.html b/layouts/partials/topbar/button/print.html index 8d717de26b..25edd43029 100644 --- a/layouts/partials/topbar/button/print.html +++ b/layouts/partials/topbar/button/print.html @@ -3,7 +3,11 @@ {{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }} {{- with .page }} {{- $printFormat := .OutputFormats.Get "print" }} - {{- if $printFormat }} + {{- $show := $printFormat }} + {{- if $show }} + {{- $show = not (partial "pageHelper/isRelearnSpecialPage.html" .) }} + {{- end }} + {{- if $show }} {{- partial "topbar/func/button.html" (dict "page" . "class" "topbar-button-print"