From b5dc64935a0fd69afdae9980feac1151e07e8b99 Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Sun, 1 Sep 2019 08:32:49 +0200 Subject: [PATCH] layout: improve taxonomies pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * NEW Adds a templates for categories and tags lists. * NEW Styles (not so well…) the categories and tags lists. * BETTER Improves includes in the _default templates. Co-Authored-by: Igor Milhit --- layouts/_default/baseof.html | 4 +++- layouts/_default/list.html | 28 ++++++++++++++-------------- layouts/_default/section.html | 34 ++++++++++++++++++---------------- layouts/_default/single.html | 2 -- layouts/_default/terms.html | 15 +++++++++++++++ static/style.css | 9 +++++++++ 6 files changed, 59 insertions(+), 33 deletions(-) create mode 100644 layouts/_default/terms.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index c4963da..f1e2252 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -3,7 +3,9 @@ {{- partial "head.html" . -}} {{- partial "header.html" . -}} - {{- block "main" . }}{{- end }} +
+ {{- block "main" . }}{{- end }} +
{{- partial "footer.html" . -}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index adcde02..961c6a5 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,18 +1,18 @@ {{ define "main" }} -
-
-

{{.Title}}

-
- - {{.Content}} -
- +
+

{{.Title}}

+
+ + {{.Content}} +
+ {{ range .Pages }} -
- {{.Title}} - — {{.PublishDate.Format "2006-01-02"}} -
+
+ {{ .Page.Title }} — + {{ if isset .Params "publishdate" }} + {{.PublishDate.Format "2006-01-02"}} + {{ end }} +
{{ end }} -
-
+ {{ end }} diff --git a/layouts/_default/section.html b/layouts/_default/section.html index e614194..324e260 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -1,20 +1,22 @@ {{ define "main" }} -
- {{ .Content }} - {{ range .Paginator.Pages }} -
- - {{.Title}} - - — {{ .PublishDate.Format "2006-01-02" }} - {{ with .Params.categories }} - {{ range . }} - — {{ . }} - {{ end }} - {{ end }} -
+
+

{{.Title}}

+
+ + {{.Content }} + {{ range .Paginator.Pages }} +
+ + {{.Title}} + + — {{ .PublishDate.Format "2006-01-02" }} + {{ with .Params.categories }} + {{ range . }} + — {{ . }} + {{ end }} {{ end }} - -
+ + {{ end }} + {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 977c0d9..a81308f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,5 +1,4 @@ {{ define "main" }} -

{{ .Title }}

{{- partial "post-info.html" . -}} @@ -7,6 +6,5 @@
{{ .Content }}
-
{{ end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..ae6f5d9 --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,15 @@ +{{ define "main" }} +
+

{{.Title}}

+
+ + {{.Content}} +
+ {{ range .Data.Terms.Alphabetical }} + + {{ end }} +
+{{ end }} + diff --git a/static/style.css b/static/style.css index 75bcede..361473b 100644 --- a/static/style.css +++ b/static/style.css @@ -196,3 +196,12 @@ figure p { text-align: center; margin: .2rem 0; } + +.terms { + display: flex; + flex-wrap: wrap; +} + +.term { + margin-right: 1rem; +}