diff options
Diffstat (limited to 'layouts/_default/archives.html')
| -rw-r--r-- | layouts/_default/archives.html | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index 966da8a..dd53699 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -9,7 +9,13 @@ {{- end }} </header> -{{- $pages := where site.AllPages "Type" "in" site.Params.mainSections }} +{{/* get pages from the current page's section */}} +{{/* in this way, archives.html could be used for section archives other than the only one archives of the whole site */}} +{{- $sections := site.Params.mainSections }} +{{- if .Section }} + {{- $sections = slice .Section }} +{{- end }} +{{- $pages := where (where site.RegularPages "Section" "in" $sections) "Params.hidden" "!=" true }} {{- range $pages.GroupByPublishDate "2006" }} {{- if ne .Key "0001" }} @@ -22,7 +28,6 @@ <h3 class="archive-month-header">{{- .Key }}<sup class="archive-count"> {{ len .Pages }}</sup></h3> <div class="archive-posts"> {{- range .Pages }} - {{- if eq .Kind "page" }} <div class="archive-entry"> <h3 class="archive-entry-title"> {{- .Title | markdownify }} @@ -34,7 +39,6 @@ <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> </div> {{- end }} - {{- end }} </div> </div> {{- end }} |
