From 414391ce09a70e75341df44424419db692550976 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 29 Jan 2022 14:38:08 +0100 Subject: [PATCH] feat: add taxonomy list template (#172) --- layouts/_default/list.html | 8 ++++-- layouts/_default/single.html | 16 +++++------ layouts/_default/taxonomy.html | 49 ++++++++++++++++++++++++++++++++++ layouts/partials/metadata.html | 14 +++++----- src/icons/star.svg | 5 ++++ src/icons/tag.svg | 5 ++++ src/sass/_base.scss | 34 +++++++++-------------- 7 files changed, 91 insertions(+), 40 deletions(-) create mode 100644 layouts/_default/taxonomy.html create mode 100644 src/icons/star.svg create mode 100644 src/icons/tag.svg diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 7c6844f..61ff6ed 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -8,7 +8,9 @@ {{ range $paginator.Pages }}
-

{{ partial "title" . }}

+

+ {{ partial "title" . }} +

@@ -28,7 +30,9 @@
- {{ partial "metadata.html" . }} +
{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 4bf0654..08090b1 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -16,16 +16,14 @@ {{ end }} -

{{ partial "title" . }}

- - - {{ if or (eq .Type (default "posts" .Site.Params.GeekblogContentSection)) (eq .Type "post") }} -
- {{ partial "metadata.html" . }} -
- {{ end }} - +

{{ partial "title" . }}

+ {{ if or (eq .Type (default "posts" .Site.Params.GeekblogContentSection)) (eq .Type "post") }} +
+ {{ partial "metadata.html" . }} +
+ {{ end }} +
{{ partial "content" . }}
diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 0000000..46bb48e --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,49 @@ +{{ define "main" }} + {{ $paginator := .Paginate .Paginator.Pages }} + {{ range $paginator.Pages.ByTitle }} +
+
+

+ {{ partial "title" . }} +

+
+ +
+ + {{ $pageCount := len .Pages }} + + + + + + + + {{ $latet := index .Pages.ByDate 0 }} + {{ with $latet }} + {{ partial "title" . }} + {{ end }} + by + {{ $ac := 0 }} + {{ with $latet.Params.authors }} + {{ range sort . }} + {{ $author := index $.Site.Data.authors . }} + {{ with $.Site.GetPage (printf "/authors/%s" . | urlize) }} + {{ if eq $ac 0 }} + {{ template "post-author" dict "name" $author.name "page" . }} + {{ else }} + {{ template "post-author" dict "name" $author.name "page" . }} + {{ end }} + {{ end }} + {{ $ac = (add $ac 1) }} + {{ end }} + {{ end }} + + +
+
+ {{ end }} + {{ partial "pagination.html" . }} +{{ end }} diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html index fa1b01f..cc14149 100644 --- a/layouts/partials/metadata.html +++ b/layouts/partials/metadata.html @@ -1,4 +1,4 @@ - + - + {{ if eq .Params.weight 1 }} - + @@ -28,7 +28,7 @@ {{ $author := index $.Site.Data.authors . }} {{ with $.Site.GetPage (printf "/authors/%s" . | urlize) }} {{ if eq $ac 0 }} - + {{ template "post-author" dict "name" $author.name "page" . }} @@ -46,7 +46,7 @@ {{ $name := . }} {{ with $.Site.GetPage (printf "/tags/%s" $name | urlize) }} {{ if eq $tc 0 }} - + {{ template "post-tag" dict "name" $name "page" . }} @@ -59,7 +59,7 @@ {{ end }} {{ define "post-tag" }} -