diff options
-rw-r--r-- | themes/hugo-pt2021/layouts/articles/list.html | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/themes/hugo-pt2021/layouts/articles/list.html b/themes/hugo-pt2021/layouts/articles/list.html index 8db3f26..f9c747b 100644 --- a/themes/hugo-pt2021/layouts/articles/list.html +++ b/themes/hugo-pt2021/layouts/articles/list.html @@ -3,6 +3,9 @@ {{- end -}} {{- define "main" -}} + {{/* get visible articles */}} + {{- $rows := union (where .Pages "Params.show" true) (where .Pages "Params.show" nil) -}} + <div class='container'> <div class='section is-small'> <h1 class='title' title='{{.Title}}' aria-label='{{.Title}}'> @@ -11,18 +14,18 @@ <div class='content'> <ul> - {{- range .Pages -}} - {{- if default true .Params.show -}} - <li> - <a - href='{{.Permalink}}' - title='{{.Title}}' - aria-label='{{.Title}}' - > - {{- .Title -}} - </a> - </li> - {{- end -}} + {{- range $rows.ByTitle -}} + <li> + <a + href='{{.Permalink}}' + title='{{.Title}}' + aria-label='{{.Title}}' + > + {{- .Title -}} + </a> + </li> + {{- else -}} + <li>No articles.</li> {{- end -}} </ul> </div><!-- content --> |