Skip to content

Commit

Permalink
Fix list fragment not listing pages from all sections
Browse files Browse the repository at this point in the history
  • Loading branch information
mpourismaiel committed Jan 18, 2020
1 parent 685a911 commit a652ea5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion layouts/partials/helpers/list-pages.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{{/* Sets page to either the given frontmatter section variable, current
parent section or if the current page is a section, the current page */}}
{{- .page_scratch.Set "page" (.Site.GetPage "Section" (.Params.section | default .root.Section)) -}}
{{- $page := cond (ne .Params.section nil) .Params.section .root.Section -}}
{{/* Weird Hugo hack coming up. Homepage and some sections' pages are fetched
with different types! */}}
{{- .page_scratch.Set "page" ((.Site.GetPage "Section" $page) | default (.Site.GetPage "section" $page)) -}}
{{- if .root.CurrentSection -}}
{{- if and (not .Params.section) (eq .root.CurrentSection.Kind "section") -}}
{{- .page_scratch.Set "page" .root.CurrentSection -}}
Expand Down

0 comments on commit a652ea5

Please sign in to comment.