From de84bc5ddf48f83b40f5ddfedbb5a56a5644b40e Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Mon, 9 May 2022 19:21:39 -0500 Subject: [PATCH] Update tags and categories to both use the same layouts --- assets/css/bobastyle.css | 68 +++++++------------- i18n/en.yaml | 6 +- i18n/es.yaml | 6 +- layouts/categories/list.html | 30 --------- layouts/categories/term.html | 17 ----- layouts/partials/post-metadata/category.html | 6 -- layouts/partials/post-metadata/taxonomy.html | 6 ++ layouts/tags/list.html | 22 ------- layouts/tags/term.html | 15 ----- layouts/taxonomy/list.html | 25 +++++-- layouts/taxonomy/term.html | 11 +++- 11 files changed, 65 insertions(+), 147 deletions(-) delete mode 100644 layouts/categories/list.html delete mode 100644 layouts/categories/term.html delete mode 100644 layouts/partials/post-metadata/category.html create mode 100644 layouts/partials/post-metadata/taxonomy.html delete mode 100644 layouts/tags/list.html delete mode 100644 layouts/tags/term.html diff --git a/assets/css/bobastyle.css b/assets/css/bobastyle.css index b823444..d209225 100644 --- a/assets/css/bobastyle.css +++ b/assets/css/bobastyle.css @@ -135,72 +135,50 @@ -/* Category list format */ -.category-list ul { - display: flex; - flex-direction: column; - list-style: none; - gap: 10px; - padding: 0; +/* Taxonomy list format */ +.taxonomy-list a, +.taxonomy-list .taxonomy-metadata { + white-space: nowrap; } -.category-list li { +.taxonomy-list p { + margin: 0; +} + +.taxonomy-list ul { + list-style: none; + padding: 0; display: flex; - flex-direction: row; - gap: 20px; + flex-direction: column; + gap: 10px; +} + +.taxonomy-list li { background-color: var(--background-1); padding: 8px 12px; border-radius: 8px; + display: flex; + flex-direction: row; + gap: 20px; } -.category-list-left { +.taxonomy-list-left { display: flex; flex-direction: column; } @media (max-width: 480px) { - .category-list li { + .taxonomy-list li { flex-direction: column; - gap: 0; + gap: 4px; } - .category-list-left { + .taxonomy-list-left { flex-direction: row; justify-content: space-between; } } -.category-list p { - margin: 0; -} - -.category-list a, -.category-list .category-metadata { - white-space: nowrap; -} - - - -/* Tags list format */ -.tag-list ul { - display: flex; - list-style: none; - gap: 10px; - flex-flow: row wrap; - padding: 0; -} - -.tag-list a { - background-color: var(--background-1); - padding: 8px 12px; - border-radius: 12px; -} - -.tag-list a:hover { - text-decoration: none; - background-color: var(--background-2); -} - /* Series list format */ diff --git a/i18n/en.yaml b/i18n/en.yaml index 7a80aa0..d537b1b 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -94,8 +94,8 @@ aria_post_metadata: aria_author_metadata: other: "author metadata" -aria_category_metadata: - other: "category metadata" +aria_taxonomy_metadata: + other: "taxonomy metadata" aria_post_meta_date: other: "date" @@ -109,7 +109,7 @@ aria_author_post_count: aria_author_word_count: other: "word count" -aria_category_post_count: +aria_taxonomy_post_count: other: "post count" aria_series_metadata: diff --git a/i18n/es.yaml b/i18n/es.yaml index 84cf142..c43d681 100644 --- a/i18n/es.yaml +++ b/i18n/es.yaml @@ -94,8 +94,8 @@ newer_post: # aria_author_metadata: # other: "author metadata" -# aria_category_metadata: -# other: "category metadata" +# aria_taxonomy_metadata: +# other: "taxonomy metadata" # aria_post_meta_date: # other: "date" @@ -109,7 +109,7 @@ newer_post: # aria_author_word_count: # other: "word count" -# aria_category_post_count: +# aria_taxonomy_post_count: # other: "post count" # aria_series_metadata: diff --git a/layouts/categories/list.html b/layouts/categories/list.html deleted file mode 100644 index 36d595a..0000000 --- a/layouts/categories/list.html +++ /dev/null @@ -1,30 +0,0 @@ -{{ define "main" }} -

- {{ partial "icon.html" "folder" }} - {{ .Title | markdownify }} -

- -
- {{ with .Data.Terms.Alphabetical }} - - {{ else }} -
- {{ i18n "no_posts" }} -
- {{ end }} -
-{{ end }} diff --git a/layouts/categories/term.html b/layouts/categories/term.html deleted file mode 100644 index 16a783f..0000000 --- a/layouts/categories/term.html +++ /dev/null @@ -1,17 +0,0 @@ -{{ define "main" }} -

- {{ partial "icon.html" "folder" }} - {{ .Title | markdownify }} - {{ partial "rss-link.html" . }} -

- - {{ partial "post-metadata/category.html" . }} - - {{ with .Content }} - {{ . }} - {{ end }} - - {{ partial "page-list.html" .Paginator.Pages }} - - {{ partial "pagination.html" . }} -{{ end }} diff --git a/layouts/partials/post-metadata/category.html b/layouts/partials/post-metadata/category.html deleted file mode 100644 index e43b020..0000000 --- a/layouts/partials/post-metadata/category.html +++ /dev/null @@ -1,6 +0,0 @@ -
- - {{ partial "icon.html" "newspaper" }} - {{ i18n "post_count" (len .Data.Pages) }} - -
diff --git a/layouts/partials/post-metadata/taxonomy.html b/layouts/partials/post-metadata/taxonomy.html new file mode 100644 index 0000000..17fd593 --- /dev/null +++ b/layouts/partials/post-metadata/taxonomy.html @@ -0,0 +1,6 @@ +
+ + {{ partial "icon.html" "newspaper" }} + {{ i18n "post_count" (len .Data.Pages) }} + +
diff --git a/layouts/tags/list.html b/layouts/tags/list.html deleted file mode 100644 index 38ef5fd..0000000 --- a/layouts/tags/list.html +++ /dev/null @@ -1,22 +0,0 @@ -{{ define "main" }} -

- {{ partial "icon.html" "tag" }} - {{ .Title | markdownify }} -

- -
- {{ with .Data.Terms.Alphabetical }} - - {{ else }} -
- {{ i18n "no_posts" }} -
- {{ end }} -
-{{ end }} diff --git a/layouts/tags/term.html b/layouts/tags/term.html deleted file mode 100644 index eb01e8b..0000000 --- a/layouts/tags/term.html +++ /dev/null @@ -1,15 +0,0 @@ -{{ define "main" }} -

- {{ partial "icon.html" "tag" }} - {{ .Title | markdownify }} - {{ partial "rss-link.html" . }} -

- - {{ with .Content }} - {{ . }} - {{ end }} - - {{ partial "page-list.html" .Paginator.Pages }} - - {{ partial "pagination.html" . }} -{{ end }} diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html index a3168c4..87c07f1 100644 --- a/layouts/taxonomy/list.html +++ b/layouts/taxonomy/list.html @@ -1,16 +1,31 @@ {{ define "main" }}

- {{ partial "icon.html" "filter" }} + {{ if eq .Data.Singular "tag" }} + {{ partial "icon.html" "tag" }} + {{ else if eq .Data.Singular "category" }} + {{ partial "icon.html" "folder" }} + {{ else }} + {{ partial "icon.html" "filter" }} + {{ end }} + {{ .Title | markdownify }}

-
+
{{ with .Data.Terms.Alphabetical }} {{ else }} diff --git a/layouts/taxonomy/term.html b/layouts/taxonomy/term.html index 4e08ec1..fe44a14 100644 --- a/layouts/taxonomy/term.html +++ b/layouts/taxonomy/term.html @@ -1,10 +1,19 @@ {{ define "main" }}

- {{ partial "icon.html" "filter" }} + {{ if eq .Data.Singular "tag" }} + {{ partial "icon.html" "tag" }} + {{ else if eq .Data.Singular "category" }} + {{ partial "icon.html" "folder" }} + {{ else }} + {{ partial "icon.html" "filter" }} + {{ end }} + {{ .Title | markdownify }} {{ partial "rss-link.html" . }}

+ {{ partial "post-metadata/taxonomy.html" . }} + {{ with .Content }} {{ . }} {{ end }}