aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2021-03-12 22:12:27 -0500
committerThedro Neely <thedroneely@gmail.com>2021-03-12 22:12:27 -0500
commit7bf900b84c38f125d96a3aa63f8f3709b48c67a2 (patch)
tree4cd81503c7cec129dd1be8baddb67506eda3acd7
parent17636fcd0897040c5e56a81a3048dfeda2420df7 (diff)
downloadthedroneely.com-7bf900b84c38f125d96a3aa63f8f3709b48c67a2.tar.gz
thedroneely.com-7bf900b84c38f125d96a3aa63f8f3709b48c67a2.tar.bz2
thedroneely.com-7bf900b84c38f125d96a3aa63f8f3709b48c67a2.zip
generators/hugo/layouts/_default/archive: Simplify implementation
-rw-r--r--generators/hugo/themes/tdro/layouts/_default/archive.html34
-rw-r--r--public/css/tdro.css1
2 files changed, 14 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>
diff --git a/public/css/tdro.css b/public/css/tdro.css
index 9e35ea7..88fe6e0 100644
--- a/public/css/tdro.css
+++ b/public/css/tdro.css
@@ -3985,6 +3985,7 @@ ul.article__list { line-height: 2.5; }
.article__list a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article__list__date { padding-right: 1rem; text-transform: uppercase; }
.article__list a, h1.article__list { padding: 0 0.5rem; }
+h1.article__list:not(:first-child) { margin-top: 1.5rem; }
.article__heading__anchor { border-bottom: none; }
.webring li { padding-top: 1em; }