From d774192b8de67b2c967f8ff50a3edac614831b58 Mon Sep 17 00:00:00 2001 From: Jacob Zhong Date: Sat, 14 Jan 2023 17:26:42 -0500 Subject: [PATCH] Add link to navbar sections and refactor names --- i18n/ar.yaml | 8 ------- i18n/bn.yaml | 7 ------ i18n/ca.yaml | 7 ------ i18n/de.yaml | 8 ------- i18n/el.yaml | 4 ---- i18n/en.yaml | 7 ------ i18n/es.yaml | 7 ------ i18n/fa.yaml | 7 ------ i18n/fr.yaml | 4 ---- i18n/hu.yaml | 7 ------ i18n/id.yaml | 8 ------- i18n/it.yaml | 8 ------- i18n/ja.yaml | 8 ------- i18n/ko.yaml | 8 ------- i18n/nl.yaml | 7 ------ i18n/pl.yaml | 8 ------- i18n/pt-br.yaml | 6 ----- i18n/pt-pt.yaml | 6 ----- i18n/ru.yaml | 3 --- i18n/th.yaml | 4 ---- i18n/tr.yaml | 3 --- i18n/uk.yaml | 4 ---- i18n/vi.yaml | 8 ------- i18n/zh-cn.yaml | 8 ------- i18n/zh-hk.yaml | 7 ------ i18n/zh-tw.yaml | 4 ---- layouts/_default/list.html | 2 +- layouts/partials/widget/archives.html | 2 +- layouts/partials/widget/categories.html | 32 +++++++++++++++---------- layouts/partials/widget/tag-cloud.html | 32 +++++++++++++++---------- 30 files changed, 40 insertions(+), 194 deletions(-) diff --git a/i18n/ar.yaml b/i18n/ar.yaml index 63101aa..3edba21 100644 --- a/i18n/ar.yaml +++ b/i18n/ar.yaml @@ -48,14 +48,6 @@ widget: more: other: اكثر - tagCloud: - title: - other: وسوم - - categoriesCloud: - title: - other: التصنيفات - search: title: other: بحث diff --git a/i18n/bn.yaml b/i18n/bn.yaml index 36f25a3..b201ac3 100644 --- a/i18n/bn.yaml +++ b/i18n/bn.yaml @@ -48,13 +48,6 @@ widget: more: other: আরও - tagCloud: - title: - other: ট্যাগ - categoriesCloud: - title: - other: বিভাগ - search: title: other: অনুসন্ধান diff --git a/i18n/ca.yaml b/i18n/ca.yaml index af4167e..acbb1c8 100644 --- a/i18n/ca.yaml +++ b/i18n/ca.yaml @@ -48,13 +48,6 @@ widget: more: other: Més - tagCloud: - title: - other: Etiquetes - categoriesCloud: - title: - other: Categories - search: title: other: Cerca diff --git a/i18n/de.yaml b/i18n/de.yaml index 7ab5b56..bf6d2d2 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -48,14 +48,6 @@ widget: more: other: Weitere - tagCloud: - title: - other: Schlagwörter - - categoriesCloud: - title: - other: Kategorien - search: title: other: Suche diff --git a/i18n/el.yaml b/i18n/el.yaml index 27a147d..30e356e 100644 --- a/i18n/el.yaml +++ b/i18n/el.yaml @@ -48,10 +48,6 @@ widget: more: other: Περισσότερα - tagCloud: - title: - other: Tags - search: title: other: Αναζήτηση diff --git a/i18n/en.yaml b/i18n/en.yaml index fb07328..0741708 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -48,13 +48,6 @@ widget: more: other: More - tagCloud: - title: - other: Tags - categoriesCloud: - title: - other: Categories - search: title: other: Search diff --git a/i18n/es.yaml b/i18n/es.yaml index 76995da..765e1dc 100644 --- a/i18n/es.yaml +++ b/i18n/es.yaml @@ -48,13 +48,6 @@ widget: more: other: Más - tagCloud: - title: - other: Etiquetas - categoriesCloud: - title: - other: Categorías - search: title: other: Búsqueda diff --git a/i18n/fa.yaml b/i18n/fa.yaml index 3655757..02220da 100644 --- a/i18n/fa.yaml +++ b/i18n/fa.yaml @@ -48,13 +48,6 @@ widget: more: other: بیشتر - tagCloud: - title: - other: تگ ها - categoriesCloud: - title: - other: دسته بندی - search: title: other: جستجو diff --git a/i18n/fr.yaml b/i18n/fr.yaml index c3feb1d..b6ac416 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -47,10 +47,6 @@ widget: more: other: Autres - tagCloud: - title: - other: Mots clés - search: title: other: Rechercher diff --git a/i18n/hu.yaml b/i18n/hu.yaml index 5e5af92..e65e5b4 100644 --- a/i18n/hu.yaml +++ b/i18n/hu.yaml @@ -48,13 +48,6 @@ widget: more: other: Több - tagCloud: - title: - other: Cimkék - categoriesCloud: - title: - other: Kategóriák - search: title: other: Keresés diff --git a/i18n/id.yaml b/i18n/id.yaml index 8104351..d156608 100644 --- a/i18n/id.yaml +++ b/i18n/id.yaml @@ -47,14 +47,6 @@ widget: more: other: Lebih - tagCloud: - title: - other: Tag - - categoriesCloud: - title: - other: Kategori - search: title: other: Cari diff --git a/i18n/it.yaml b/i18n/it.yaml index 0cbeeab..b2b955e 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -47,14 +47,6 @@ widget: more: other: Di più - tagCloud: - title: - other: Tags - - categoriesCloud: - title: - other: Categorie - search: title: other: Cerca diff --git a/i18n/ja.yaml b/i18n/ja.yaml index 40380fd..9e4f70d 100644 --- a/i18n/ja.yaml +++ b/i18n/ja.yaml @@ -34,14 +34,6 @@ widget: more: other: さらに見る - tagCloud: - title: - other: タグ - - categoriesCloud: - title: - other: カテゴリ - search: title: other: 検索 diff --git a/i18n/ko.yaml b/i18n/ko.yaml index 11cdc4a..7540f95 100644 --- a/i18n/ko.yaml +++ b/i18n/ko.yaml @@ -46,14 +46,6 @@ widget: other: 보관함 more: other: 더보기 - - categoriesCloud: - title: - other: 카테고리 - - tagCloud: - title: - other: 태그 search: title: diff --git a/i18n/nl.yaml b/i18n/nl.yaml index a814232..16ffff6 100644 --- a/i18n/nl.yaml +++ b/i18n/nl.yaml @@ -34,13 +34,6 @@ widget: other: Archief more: other: Meer - tagCloud: - title: - other: Tags - - categoriesCloud: - title: - other: Categorie search: title: diff --git a/i18n/pl.yaml b/i18n/pl.yaml index e44a140..cc5aed6 100644 --- a/i18n/pl.yaml +++ b/i18n/pl.yaml @@ -47,14 +47,6 @@ widget: more: other: Więcej - tagCloud: - title: - other: Tagi - - categoriesCloud: - title: - other: Kategorie - search: title: other: Szukaj diff --git a/i18n/pt-br.yaml b/i18n/pt-br.yaml index 2784f3d..b89e012 100644 --- a/i18n/pt-br.yaml +++ b/i18n/pt-br.yaml @@ -45,12 +45,6 @@ widget: other: Arquivos more: other: Mais - tagCloud: - title: - other: Tags - categoriesCloud: - title: - other: Categorias search: title: diff --git a/i18n/pt-pt.yaml b/i18n/pt-pt.yaml index f524969..2b24075 100644 --- a/i18n/pt-pt.yaml +++ b/i18n/pt-pt.yaml @@ -45,12 +45,6 @@ widget: other: Arquivos more: other: Mais - tagCloud: - title: - other: Tags - categoriesCloud: - title: - other: Categorias search: title: diff --git a/i18n/ru.yaml b/i18n/ru.yaml index b1f1e51..97b5bf3 100644 --- a/i18n/ru.yaml +++ b/i18n/ru.yaml @@ -44,9 +44,6 @@ widget: other: Архивы more: other: Ещё - tagCloud: - title: - other: Теги search: title: diff --git a/i18n/th.yaml b/i18n/th.yaml index 9982c06..626ba77 100644 --- a/i18n/th.yaml +++ b/i18n/th.yaml @@ -48,10 +48,6 @@ widget: more: other: อื่นๆ นอกจากนี้ - tagCloud: - title: - other: แท็ก - search: title: other: ค้นหา diff --git a/i18n/tr.yaml b/i18n/tr.yaml index 2dbb9d5..d0b0504 100644 --- a/i18n/tr.yaml +++ b/i18n/tr.yaml @@ -34,9 +34,6 @@ widget: other: Arşiv more: other: Daha fazla - tagCloud: - title: - other: Etiketler search: title: diff --git a/i18n/uk.yaml b/i18n/uk.yaml index 3bd4f71..c89b410 100644 --- a/i18n/uk.yaml +++ b/i18n/uk.yaml @@ -49,10 +49,6 @@ widget: more: other: Більше - tagCloud: - title: - other: Теґи - search: title: other: Пошук diff --git a/i18n/vi.yaml b/i18n/vi.yaml index 13dc624..b1605b9 100644 --- a/i18n/vi.yaml +++ b/i18n/vi.yaml @@ -48,14 +48,6 @@ widget: more: other: Còn nữa - tagCloud: - title: - other: Nhãn dán - - categoriesCloud: - title: - other: Chuỗi bài - search: title: other: Tìm kiếm diff --git a/i18n/zh-cn.yaml b/i18n/zh-cn.yaml index 9350c2b..18e1b17 100644 --- a/i18n/zh-cn.yaml +++ b/i18n/zh-cn.yaml @@ -34,14 +34,6 @@ widget: more: other: 更多 - tagCloud: - title: - other: 标签云 - - categoriesCloud: - title: - other: 分类 - search: title: other: 搜索 diff --git a/i18n/zh-hk.yaml b/i18n/zh-hk.yaml index 9e3c246..cfdf86e 100644 --- a/i18n/zh-hk.yaml +++ b/i18n/zh-hk.yaml @@ -48,13 +48,6 @@ widget: more: other: 更多 - tagCloud: - title: - other: Tags - categoriesCloud: - title: - other: Categories - search: title: other: 搜尋 diff --git a/i18n/zh-tw.yaml b/i18n/zh-tw.yaml index 17eb6b2..fe52c74 100644 --- a/i18n/zh-tw.yaml +++ b/i18n/zh-tw.yaml @@ -34,10 +34,6 @@ widget: more: other: 更多 - tagCloud: - title: - other: 標籤雲 - search: title: other: 搜尋 diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 9bc618d..5f3202a 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -11,7 +11,7 @@

{{ T "list.page" (len .Pages) }}

-

{{ .Title }}

+

{{ default (strings.FirstUpper .Type) .Title }}

{{ with .Params.description }}

{{ . }}

{{ end }} diff --git a/layouts/partials/widget/archives.html b/layouts/partials/widget/archives.html index 1f2abc5..96ea01b 100644 --- a/layouts/partials/widget/archives.html +++ b/layouts/partials/widget/archives.html @@ -7,7 +7,7 @@
{{ partial "helper/icon" "infinity" }}
-

{{ T "widget.archives.title" }}

+

{{ T "widget.archives.title" }}

{{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }} {{ $notHidden := where $context.Site.RegularPages "Params.hidden" "!=" true }} diff --git a/layouts/partials/widget/categories.html b/layouts/partials/widget/categories.html index 10c8a35..372022c 100644 --- a/layouts/partials/widget/categories.html +++ b/layouts/partials/widget/categories.html @@ -1,16 +1,22 @@ +{{- $query := first 1 (where (where .Context.Site.Pages "Kind" "taxonomy") "Type" "categories") -}} {{- $context := .Context -}} {{- $limit := default 10 .Params.limit -}} -
-
- {{ partial "helper/icon" "categories" }} -
-

{{ T "widget.categoriesCloud.title" }}

+{{- if $query -}} + {{- $categoriesPage := index $query 0 -}} +
+
+ {{ partial "helper/icon" "categories" }} +
+

{{ default "Categories" $categoriesPage.Title }}

-
- {{ range first $limit $context.Site.Taxonomies.categories.ByCount }} - - {{ .Page.Title }} - - {{ end }} -
-
+
+ {{ range first $limit $context.Site.Taxonomies.categories.ByCount }} + + {{ .Page.Title }} + + {{ end }} +
+
+{{- else -}} + {{- warnf "Categories page not found. Please enable the categories taxonomy." -}} +{{- end -}} diff --git a/layouts/partials/widget/tag-cloud.html b/layouts/partials/widget/tag-cloud.html index e64e5e2..413453b 100644 --- a/layouts/partials/widget/tag-cloud.html +++ b/layouts/partials/widget/tag-cloud.html @@ -1,16 +1,22 @@ +{{- $query := first 1 (where (where .Context.Site.Pages "Kind" "taxonomy") "Type" "tags") -}} {{- $context := .Context -}} {{- $limit := default 10 .Params.limit -}} -
-
- {{ partial "helper/icon" "tag" }} -
-

{{ T "widget.tagCloud.title" }}

+{{- if $query -}} + {{- $tagsPage := index $query 0 -}} +
+
+ {{ partial "helper/icon" "tag" }} +
+

{{ default "Tags" $tagsPage.Title }}

-
- {{ range first $limit $context.Site.Taxonomies.tags.ByCount }} - - {{ .Page.Title }} - - {{ end }} -
-
\ No newline at end of file +
+ {{ range first $limit $context.Site.Taxonomies.tags.ByCount }} + + {{ .Page.Title }} + + {{ end }} +
+
+{{- else -}} + {{- warnf "Categories page not found. Please enable the categories taxonomy." -}} +{{- end -}} \ No newline at end of file