From a2f296601d1d2dc49893cc8a71ce1c3fd0818705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Sat, 2 Jul 2022 22:22:46 +0800 Subject: [PATCH] :construction: optimization some module design. --- README.md | 2 +- exampleSite/config.yaml | 25 +++++++++---------- exampleSite/start.sh | 2 +- layouts/_default/baseof.html | 20 +++------------ .../partials/_thirdparty/analytics/51la.html | 4 +-- layouts/partials/head.html | 6 ++--- layouts/partials/head/analytics.html | 6 ++++- layouts/partials/head/meta.html | 18 +++++++++---- layouts/partials/head/style.html | 3 +++ layouts/partials/init.html | 14 +++++++++++ layouts/partials/scripts.html | 3 +++ theme.toml | 2 +- 12 files changed, 60 insertions(+), 45 deletions(-) create mode 100644 layouts/partials/init.html diff --git a/README.md b/README.md index 3368dd7..ba6e9fd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Hugo theme of NexT +# Hugo NexT ![hugo-next-primary](https://lisenhui.gitee.io/imgs/hugo-next/logo/hugo-next-primary.png) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 28c473f..646ca35 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -761,7 +761,7 @@ params: serverURL: # # Artalk 评论插件 - # 更多配置信息请参考: + # 更多配置信息请参考:https://artalk.js.org # Artalk comments system # More info see: https://artalk.js.org artalk: @@ -801,16 +801,16 @@ params: giscus: # Github 仓库地址,格式:用户名/仓库名称 # Github repository owner and name - repo: hugo-next/hugo-theme-next + repo: username/repo_name # Giscus 生成的仓库 Id # Generate repository Id from Giscus - repoId: R_kgDOHRjXGA + repoId: # # 讨论区的分类名称 # Github discussions category - category: Comments + category: Announcements # 讨论区分类 ID # Generate category Id from Giscus - categoryId: DIC_kwDOHRjXGM4CP8S4 + categoryId: # # 讨论区帖子标题,可选值: pathname | url | title | og:title | 自定义 # Available values: pathname | url | title | og:title | custom mapping: title @@ -848,11 +848,12 @@ params: # Statistics and Analytics # --------------------------------------------------------------- - # 51La站点统计 - # 更多信息请参考:https://invite.51.la/1NUfGTS1?target=V6 - # 51La Analytics - # See: https://invite.51.la/1NUfGTS1?target=V6 - laId: # + analytics: + # 51La 站点统计 + # 更多信息请参考:https://invite.51.la/1NUfGTS1?target=V6 + # 51La Analytics + # See: https://invite.51.la/1NUfGTS1?target=V6 + laId: # # TODO # Show Views / Visitors of the website / page with busuanzi. @@ -1029,6 +1030,4 @@ params: # The js option is only valid when vendors.internal is local. css: css js: js - images: imgs - - + images: imgs \ No newline at end of file diff --git a/exampleSite/start.sh b/exampleSite/start.sh index c917278..b4e8e82 100644 --- a/exampleSite/start.sh +++ b/exampleSite/start.sh @@ -12,7 +12,7 @@ next() { ██║ ╚████║███████╗██╔╝ ██╗ ██║ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝ ======================================== -NexT version $1 +Hugo NexT version $1 Documentation: https://hugo-next.eu.org ======================================== EOT diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index eb99ade..184cd56 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,22 +1,8 @@ -{{- .Scratch.Set "postsCount" (len (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections)) -}} -{{- .Scratch.Set "catsCount" (len .Site.Taxonomies.categories) -}} -{{- .Scratch.Set "tagsCount" (len .Site.Taxonomies.tags) -}} -{{- $vendors := .Site.Data.resources.vendors -}} -{{- $pluginVen := .Site.Params.vendors.plugins -}} -{{- $pluginCDN := index $vendors $pluginVen -}} -{{- .Scratch.Set "pluginCDN" $pluginCDN -}} +{{- partial "init.html" . -}} - - - {{ hugo.Generator }} - - - - - {{- partial "head.html" . }} {{ block "title" . }}{{ .Site.Title }}{{ end }}