Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

section-index.html code cleanup #1947

Merged
merged 1 commit into from
Apr 26, 2024
Merged
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
10 changes: 5 additions & 5 deletions layouts/partials/section-index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<div class="section-index">
{{ $parent := .Page -}}
{{ $page := .Page -}}
{{ $pages := (where .Site.Pages "Section" .Section).ByWeight -}}
{{ $pages = (where $pages "Type" "!=" "search") }}
{{ $pages = (where $pages ".Params.hide_summary" "!=" true) -}}
{{ $pages = (where $pages ".Parent" "!=" nil) -}}
{{ $pages = (where $pages ".Parent.File" "!=" nil) -}}
{{ if and $parent $parent.File -}}
{{ $pages = (where $pages "Parent.File.UniqueID" "==" $parent.File.UniqueID) -}}
{{ if $page.File -}}
{{ $pages = (where $pages "Parent.File.UniqueID" "==" $page.File.UniqueID) -}}
{{ end -}}
{{ if or $parent.Params.no_list (eq (len $pages) 0) -}}
{{ if or $page.Params.no_list (eq (len $pages) 0) -}}
{{/* If no_list is true or we don't have subpages we don't show a list of subpages */}}
{{ else if $parent.Params.simple_list -}}
{{ else if $page.Params.simple_list -}}
{{/* If simple_list is true we show a bulleted list of subpages */}}
<ul>
{{ range $pages -}}
Expand Down