From 48212b7ee81759e2d280daa7225ccd5ea21a1a1d Mon Sep 17 00:00:00 2001 From: TaurusXin Date: Thu, 16 Dec 2021 00:07:21 +0000 Subject: [PATCH] feat: categories --- assets/icons/categories.svg | 1 + config.yaml | 10 +++++++--- i18n/zh-CN.yaml | 4 ++++ layouts/partials/widget/categories.html | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 assets/icons/categories.svg create mode 100644 i18n/zh-CN.yaml create mode 100644 layouts/partials/widget/categories.html diff --git a/assets/icons/categories.svg b/assets/icons/categories.svg new file mode 100644 index 0000000..a8ee428 --- /dev/null +++ b/assets/icons/categories.svg @@ -0,0 +1 @@ +Adobe Creative Cloud icon \ No newline at end of file diff --git a/config.yaml b/config.yaml index 0d68ed7..2335980 100644 --- a/config.yaml +++ b/config.yaml @@ -30,8 +30,8 @@ params: favicon: footer: - since: 2020 - customText: + since: 2019 + customText: Made By ❤ in Hangzhou dateFormat: published: 1 月 02 日, 2006 年 @@ -135,9 +135,13 @@ params: widgets: enabled: + - categories - search - - archives - tag-cloud + - archives + + categoriesCloud: + limit: 20 archives: limit: 5 diff --git a/i18n/zh-CN.yaml b/i18n/zh-CN.yaml new file mode 100644 index 0000000..5a1c2b5 --- /dev/null +++ b/i18n/zh-CN.yaml @@ -0,0 +1,4 @@ +widget: + categoriesCloud: + title: + other: 分类 \ No newline at end of file diff --git a/layouts/partials/widget/categories.html b/layouts/partials/widget/categories.html new file mode 100644 index 0000000..b56f2bc --- /dev/null +++ b/layouts/partials/widget/categories.html @@ -0,0 +1,14 @@ +
+
+ {{ partial "helper/icon" "categories" }} +
+

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

+ +
+ {{ range first .Site.Params.widgets.categoriesCloud.limit .Site.Taxonomies.categories.ByCount }} + + {{ .Page.Title }} + + {{ end }} +
+