From 8faf99334b499a8f071397de550f164cb19b98e5 Mon Sep 17 00:00:00 2001 From: geekifan Date: Mon, 21 Apr 2025 11:17:00 +0800 Subject: [PATCH] add footer --- hugo.toml | 15 ++++++++----- i18n/en.yaml | 6 +++++ i18n/zh.yaml | 6 +++++ layouts/_default/baseof.html | 1 + layouts/partials/footer.html | 42 +++++++++++++++++++++++++++++++++++ layouts/partials/sidebar.html | 4 ++-- 6 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 layouts/partials/footer.html diff --git a/hugo.toml b/hugo.toml index 7a0f0ce..5979e09 100644 --- a/hugo.toml +++ b/hugo.toml @@ -19,24 +19,27 @@ path = "github.com/gohugoio/hugo-mod-bootstrap-scss/v5" pre = "fa-solid fa-house" [params] + theme_version = "5.2.0" - [[params.social]] +[params.social] + name = "Yifan" + url = "https://www.yifan.com" + [[params.social.links]] type = "github" id = "yourusername" # 或直接使用 url = "https://github.com/yourusername" icon = "fab fa-github" - [[params.social]] + [[params.social.links]] type = "twitter" id = "yourhandle" icon = "fab fa-twitter" - [[params.social]] + [[params.social.links]] type = "email" id = "your.email@example.com" # 会被自动分割处理 icon = "fas fa-envelope" - [[params.social]] + [[params.social.links]] type = "rss" icon = "fas fa-rss" - noblank = true # 不在新窗口打开 - \ No newline at end of file + noblank = true # 不在新窗口打开 \ No newline at end of file diff --git a/i18n/en.yaml b/i18n/en.yaml index 479cf05..acc2914 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -18,3 +18,9 @@ search: panel: lastmod: "Recently Updated" trending_tags: "Trending Tags" + +copyright: + brief: "All rights reserved" + verbose: "All rights reserved" + +meta: "Powered by :PLATFORM with :THEME theme" diff --git a/i18n/zh.yaml b/i18n/zh.yaml index b30f8fc..9815ef3 100644 --- a/i18n/zh.yaml +++ b/i18n/zh.yaml @@ -18,3 +18,9 @@ search: panel: lastmod: "最近更新" trending_tags: "热门标签" + +copyright: + brief: "版权所有" + verbose: "版权所有" + +meta: "由 :PLATFORM 提供支持,主题 :THEME" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 670a39f..19145d0 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -32,6 +32,7 @@
+ {{ partialCached "footer.html" . }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..992eeaf --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,42 @@ + + \ No newline at end of file diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index db66f42..6f1b451 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -37,12 +37,12 @@ - {{ if .Site.Params.social }} + {{ if .Site.Params.social.links }} {{ end }} {{ end }} - {{ range .Site.Params.social }} + {{ range .Site.Params.social.links }} {{ $url := "" }} {{ $rel := "" }}