diff options
author | Thedro Neely <thedroneely@gmail.com> | 2021-03-12 22:12:27 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2021-03-12 22:12:27 -0500 |
commit | 7bf900b84c38f125d96a3aa63f8f3709b48c67a2 (patch) | |
tree | 4cd81503c7cec129dd1be8baddb67506eda3acd7 /generators/hugo/themes/tdro/layouts/_default/archive.html | |
parent | 17636fcd0897040c5e56a81a3048dfeda2420df7 (diff) | |
download | thedroneely.com-7bf900b84c38f125d96a3aa63f8f3709b48c67a2.tar.gz thedroneely.com-7bf900b84c38f125d96a3aa63f8f3709b48c67a2.tar.bz2 thedroneely.com-7bf900b84c38f125d96a3aa63f8f3709b48c67a2.zip |
generators/hugo/layouts/_default/archive: Simplify implementation
Diffstat (limited to 'generators/hugo/themes/tdro/layouts/_default/archive.html')
-rw-r--r-- | generators/hugo/themes/tdro/layouts/_default/archive.html | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/generators/hugo/themes/tdro/layouts/_default/archive.html b/generators/hugo/themes/tdro/layouts/_default/archive.html index feecc81..4d9d910 100644 --- a/generators/hugo/themes/tdro/layouts/_default/archive.html +++ b/generators/hugo/themes/tdro/layouts/_default/archive.html @@ -3,38 +3,30 @@ <div class="container"> <div class="columns is-centered"> <div class="column is-7"> - - {{ $type := .Type }} - {{ $.Scratch.Set "count" 1 }} + {{ $type := .Type }} {{ range (.Site.RegularPages.GroupByDate "2006") }} - {{ if (gt .Key 2000) }} + {{ $articles := (where .Pages "Type" $type) }} + {{ if and (gt .Key 1) (gt (where .Pages "Type" $type) 0) }} - {{ range (where .Pages "Type" $type) }} - {{ if (eq ($.Scratch.Get "count") 1) }} - {{ $.Scratch.Set "count" 0 }} - <h1 class="article__list title is-4 has-text-weight-normal has-margin-bottom-lg">{{ .Date.Format "2006" }}</h1> - {{ end }} + {{ range (first 1 $articles) }} + <h1 class="article__list title is-4 has-text-weight-normal has-margin-bottom-lg">{{ .Date.Format "2006" }}</h1> {{ end }} - {{ $.Scratch.Set "count" 1 }} - - <ul class="article__list"> - {{ range (where .Pages "Type" $type) }} + <ul class="article__list"> + {{ range $articles }} {{ if (ne .Params.hidden true) }} - <li> - <a class="is-block" href="{{ .RelPermalink }}"> - <span class="article__list__date monospace has-text-grey-dark">{{ .Date.Format "02 Jan" }}</span>{{ .Title }} - </a> - </li> + <li> + <a class="is-block" href="{{ .RelPermalink }}"> + <span class="article__list__date monospace has-text-grey-dark">{{ .Date.Format "02 Jan" }}</span>{{ .Title }} + </a> + </li> {{ end }} {{ end }} - </ul> - <br> + {{ end }} {{ end }} - {{ end }} </div> </div> |