Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions themes/mieweb-docs/layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ <h1 class="text-foreground text-3xl font-bold tracking-tight sm:text-4xl">{{ .Ti

{{- /* Content from _index.md */}} {{ if .Content }}
<article class="prose prose-neutral dark:prose-invert mb-8 max-w-none">{{ .Content | safeHTML }}</article>
{{ 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 }}
<section aria-label="Child pages">
<div class="grid gap-4 sm:grid-cols-2">
{{ range .Pages }}
{{ range $visiblePages }}
<a href="{{ .RelPermalink }}" class="card card-interactive group p-6">
<div class="flex items-start justify-between">
<h3 class="text-foreground font-semibold">{{ .Title }}</h3>
Expand Down
2 changes: 2 additions & 0 deletions themes/mieweb-docs/layouts/_default/search.json
Original file line number Diff line number Diff line change
@@ -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. */}}
Expand All @@ -11,5 +12,6 @@
"content" $content
"rawContent" $raw
) }}
{{- end }}
{{- end }}
{{- $index | jsonify }}
2 changes: 2 additions & 0 deletions themes/mieweb-docs/layouts/partials/is-hidden-page.html
Original file line number Diff line number Diff line change
@@ -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:")) -}}
2 changes: 2 additions & 0 deletions themes/mieweb-docs/layouts/shortcodes/children-inner.html
Original file line number Diff line number Diff line change
@@ -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" .) }}
<div class="flex-1">
<a href="{{ .RelPermalink }}" class="text-primary font-medium hover:underline">{{ .Title }}</a>
</div>
{{ end }}
{{ end }}
4 changes: 2 additions & 2 deletions themes/mieweb-docs/layouts/shortcodes/children.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +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 }}
<div class="my-6 grid gap-3 sm:grid-cols-2">
{{- range $pages }}
{{- range $visiblePages }}
<a href="{{ .RelPermalink }}" class="card card-interactive group flex items-center gap-3 p-4">
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down