From 331df6a874f11d083d73013850d210da3d88a1c9 Mon Sep 17 00:00:00 2001 From: TaurusXin Date: Sun, 20 Mar 2022 23:44:08 +0000 Subject: [PATCH] fix new theme config --- config.yaml | 41 ++++++++++++++----------- i18n/zh-CN.yaml | 2 +- layouts/partials/widget/categories.html | 14 --------- layouts/partials/widget/status.html | 10 +++--- 4 files changed, 29 insertions(+), 38 deletions(-) delete mode 100644 layouts/partials/widget/categories.html diff --git a/config.yaml b/config.yaml index ee0cd4f..709f4a5 100644 --- a/config.yaml +++ b/config.yaml @@ -134,25 +134,24 @@ params: id: widgets: - enabled: - - categories - - search - - tag-cloud - - archives - - status + homepage: + - type: search + - type: archives + params: + limit: 5 + - type: categories + params: + limit: 10 + - type: tag-cloud + params: + limit: 10 + - type: status + params: + start: 2018-08-04 + format: yyyy 年 MM 月 dd 日 - categoriesCloud: - limit: 20 - - archives: - limit: 5 - - tagCloud: - limit: 10 - - status: - start: 2018-08-04 - format: yyyy 年 MM 月 dd 日 + page: + - type: toc opengraph: twitter: @@ -249,5 +248,11 @@ markup: startLevel: 2 highlight: noClasses: false + codeFences: true + guessSyntax: true + lineNoStart: 1 + lineNos: true + lineNumbersInTable: true + tabWidth: 4 disqusShortname: taurusxin diff --git a/i18n/zh-CN.yaml b/i18n/zh-CN.yaml index 4ee2567..cae4f2f 100644 --- a/i18n/zh-CN.yaml +++ b/i18n/zh-CN.yaml @@ -6,5 +6,5 @@ widget: status: title: 状态 postCount: 文章数量 - start: 博客起始 + start: 博客始于 time: 稳定运行 \ No newline at end of file diff --git a/layouts/partials/widget/categories.html b/layouts/partials/widget/categories.html deleted file mode 100644 index b56f2bc..0000000 --- a/layouts/partials/widget/categories.html +++ /dev/null @@ -1,14 +0,0 @@ -
-
- {{ partial "helper/icon" "categories" }} -
-

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

- -
- {{ range first .Site.Params.widgets.categoriesCloud.limit .Site.Taxonomies.categories.ByCount }} - - {{ .Page.Title }} - - {{ end }} -
-
diff --git a/layouts/partials/widget/status.html b/layouts/partials/widget/status.html index 1e35c2a..32ab5bb 100644 --- a/layouts/partials/widget/status.html +++ b/layouts/partials/widget/status.html @@ -1,7 +1,7 @@ -{{/*-- post count */}} {{ $posts := (where .Site.RegularPages "Section" "==" "post") }} {{ -$postCount := len $posts }} +{{/*-- post count */}} {{ $posts := (where .Context.Site.Pages "Section" "==" "post") }} +{{ $postCount := len $posts }} -
+
{{ partial "helper/icon" "status" }}

{{ T "widget.status.title" }}

@@ -43,8 +43,8 @@ $postCount := len $posts }} } - let start = new Date({{ .Site.Params.widgets.status.start }}) - let startFormated = start.format({{ .Site.Params.widgets.status.format }}) + let start = new Date({{ .Params.start }}) + let startFormated = start.format({{ .Params.format }}) document.querySelector('#start').innerHTML = startFormated start.setMonth(start.getMonth() - 1)