From 6c2f27d668484f92c1b229b017984818ee99041d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 May 2026 15:10:48 +0000 Subject: [PATCH 1/3] Initial plan From 1d09a053b7826c52a92d3b228314924e1049f4d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 May 2026 15:15:31 +0000 Subject: [PATCH 2/3] Filter redirect/conflict pages from listings and search index Agent-Logs-Url: https://github.com/mieweb/docs/sessions/99f6a7fa-9a57-41c5-9ae0-c04201ee92b4 Co-authored-by: pierzchala-m <162727606+pierzchala-m@users.noreply.github.com> --- themes/mieweb-docs/layouts/_default/list.html | 2 ++ themes/mieweb-docs/layouts/_default/search.json | 2 ++ themes/mieweb-docs/layouts/partials/is-hidden-page.html | 2 ++ themes/mieweb-docs/layouts/shortcodes/children-inner.html | 2 ++ themes/mieweb-docs/layouts/shortcodes/children.html | 2 ++ 5 files changed, 10 insertions(+) create mode 100644 themes/mieweb-docs/layouts/partials/is-hidden-page.html diff --git a/themes/mieweb-docs/layouts/_default/list.html b/themes/mieweb-docs/layouts/_default/list.html index 0c3f70953..0eca1f785 100644 --- a/themes/mieweb-docs/layouts/_default/list.html +++ b/themes/mieweb-docs/layouts/_default/list.html @@ -18,6 +18,7 @@

{{ .Ti
{{ range .Pages }} + {{ if not (partial "is-hidden-page.html" .) }}
{{ end }} diff --git a/themes/mieweb-docs/layouts/_default/search.json b/themes/mieweb-docs/layouts/_default/search.json index ed2c640d8..b7d2dbb74 100644 --- a/themes/mieweb-docs/layouts/_default/search.json +++ b/themes/mieweb-docs/layouts/_default/search.json @@ -1,6 +1,7 @@ {{- /* Search index JSON output */}} {{- $index := slice }} {{- range .Site.RegularPages }} + {{- if not (partial "is-hidden-page.html" .) }} {{- $content := .Plain | truncate 5000 }} {{- /* RawContent preserves markdown headings so the indexer can build anchor-level chunks that deep-link to the exact section. */}} @@ -11,5 +12,6 @@ "content" $content "rawContent" $raw ) }} + {{- end }} {{- end }} {{- $index | jsonify }} diff --git a/themes/mieweb-docs/layouts/partials/is-hidden-page.html b/themes/mieweb-docs/layouts/partials/is-hidden-page.html new file mode 100644 index 000000000..b1435c402 --- /dev/null +++ b/themes/mieweb-docs/layouts/partials/is-hidden-page.html @@ -0,0 +1,2 @@ +{{- /* Returns true if the page should be hidden from listings and search (redirect/conflict pages) */}} +{{- return (or (hasPrefix .Title "Redirect to:") (hasPrefix .Title "Conflict:")) -}} diff --git a/themes/mieweb-docs/layouts/shortcodes/children-inner.html b/themes/mieweb-docs/layouts/shortcodes/children-inner.html index 72899bef3..09958fa74 100644 --- a/themes/mieweb-docs/layouts/shortcodes/children-inner.html +++ b/themes/mieweb-docs/layouts/shortcodes/children-inner.html @@ -1,6 +1,8 @@ {{- /* Children inner shortcode */}} {{ $page := . }} {{ $pages := .Page.Pages }} {{ if not $pages }} {{ $pages = .Page.Sections }} {{ end }} {{ range $pages }} +{{ if not (partial "is-hidden-page.html" .) }}
{{ .Title }}
{{ end }} +{{ end }} diff --git a/themes/mieweb-docs/layouts/shortcodes/children.html b/themes/mieweb-docs/layouts/shortcodes/children.html index 053a3a00c..502514ca8 100644 --- a/themes/mieweb-docs/layouts/shortcodes/children.html +++ b/themes/mieweb-docs/layouts/shortcodes/children.html @@ -13,6 +13,7 @@ -}} {{- else -}} {{- $pages = $pages.ByTitle -}} {{- end -}} {{- end -}} {{- if $pages }}
{{- range $pages }} + {{- if not (partial "is-hidden-page.html" .) }} {{- end }} + {{- end }}
{{- end }} From d35879a5528272e043b905298c1a2c48fca19344 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 May 2026 15:29:36 +0000 Subject: [PATCH 3/3] Pre-filter visiblePages slice to avoid empty wrappers when all children are hidden Agent-Logs-Url: https://github.com/mieweb/docs/sessions/c2b78edf-85b2-40ff-b9eb-6363703f5290 Co-authored-by: pierzchala-m <162727606+pierzchala-m@users.noreply.github.com> --- themes/mieweb-docs/layouts/_default/list.html | 6 ++---- themes/mieweb-docs/layouts/shortcodes/children.html | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/themes/mieweb-docs/layouts/_default/list.html b/themes/mieweb-docs/layouts/_default/list.html index 0eca1f785..1cddcc1db 100644 --- a/themes/mieweb-docs/layouts/_default/list.html +++ b/themes/mieweb-docs/layouts/_default/list.html @@ -14,11 +14,10 @@

{{ .Ti {{- /* Content from _index.md */}} {{ if .Content }}
{{ .Content | safeHTML }}
- {{ end }} {{- /* Children pages */}} {{ if .Pages }} + {{ end }} {{- /* Children pages - pre-filter redirect/conflict pages */}} {{ $visiblePages := slice }} {{ range .Pages }} {{ if not (partial "is-hidden-page.html" .) }} {{ $visiblePages = $visiblePages | append . }} {{ end }} {{ end }} {{ if $visiblePages }}
- {{ range .Pages }} - {{ if not (partial "is-hidden-page.html" .) }} + {{ range $visiblePages }}
{{ end }} diff --git a/themes/mieweb-docs/layouts/shortcodes/children.html b/themes/mieweb-docs/layouts/shortcodes/children.html index 502514ca8..074e49235 100644 --- a/themes/mieweb-docs/layouts/shortcodes/children.html +++ b/themes/mieweb-docs/layouts/shortcodes/children.html @@ -10,10 +10,9 @@ child) */ -}} {{- if not (strings.Contains $remainder "/") -}} {{- $foundPages = $foundPages | append . -}} {{- end -}} {{- end -}} {{- end -}} {{- $pages = $foundPages -}} {{- end -}} {{- /* Apply sorting */ -}} {{- if $pages -}} {{- if eq $sortBy "creation" -}} {{- $pages = $pages.ByDate -}} {{- else if eq $sortBy "weight" -}} {{- $pages = $pages.ByWeight --}} {{- else -}} {{- $pages = $pages.ByTitle -}} {{- end -}} {{- end -}} {{- if $pages }} +-}} {{- else -}} {{- $pages = $pages.ByTitle -}} {{- end -}} {{- end -}} {{- /* Filter out redirect/conflict pages */ -}} {{- $visiblePages := slice -}} {{- range $pages -}} {{- if not (partial "is-hidden-page.html" .) -}} {{- $visiblePages = $visiblePages | append . -}} {{- end -}} {{- end -}} {{- if $visiblePages }}
- {{- range $pages }} - {{- if not (partial "is-hidden-page.html" .) }} + {{- range $visiblePages }} {{- end }} - {{- end }}
{{- end }}