From a58145a05fdb022b1ef7a609f7f1d2775a5b59b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Sun, 8 May 2022 11:09:51 +0800 Subject: [PATCH] :construction: :sparkles: :wrench: Add social links setting with map structure because of the array structure can't sort by source. --- assets/css/style.css | 2 +- exampleSite/config.yaml | 19 +++++++- i18n/en-us.toml | 4 ++ i18n/zh-cn.toml | 4 ++ layouts/partials/header.html | 66 +--------------------------- layouts/partials/header/sidebar.html | 66 ++++++++++++++++++++++++++++ 6 files changed, 94 insertions(+), 67 deletions(-) create mode 100644 layouts/partials/header/sidebar.html diff --git a/assets/css/style.css b/assets/css/style.css index a85d6b3..00eec91 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -6,7 +6,7 @@ } .sidebar-inner { - padding: 10px 10px 0 10px; + padding: 10px; } .site-author-image { diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 03f533f..be76b66 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -81,13 +81,30 @@ params: # If true, the avatar will be rotated with the cursor. rotated: true + # Social Links + # Usage: `Key: permalink || icon` + # Key is the link label showing to end users. + # Value before `||` delimiter is the target permalink, value after `||` delimiter is the name of Font Awesome icon. + socials: [ + { "GitHub": "https://github.com/yourname || fab fa-github" }, + { "E-Mail": "mailto:yourname@gmail.com || fa fa-envelope" } + # {"Weibo": "https://weibo.com/yourname || fab fa-weibo"}, + # {"Google": "https://plus.google.com/yourname || fab fa-google"}, + # {"Twitter": "https://twitter.com/yourname || fab fa-twitter"}, + # {"FB Page": "https://www.facebook.com/yourname || fab fa-facebook"}, + # {"StackOverflow": "https://stackoverflow.com/yourname || fab fa-stack-overflow"}, + # {"YouTube": "https://youtube.com/yourname || fab fa-youtube"}, + # {"Instagram": "https://instagram.com/yourname || fab fa-instagram"}, + # {"Skype": "skype:yourname?call|chat || fab fa-skype"} + ] + # Creative Commons 4.0 International License. # See: https://creativecommons.org/about/cclicenses/ creativeCommons: # Available values: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | cc-zero license: by-nc-nd # Available values: big | small - size: big + size: small sidebar: true post: true # You can set a language value if you prefer a translated version of CC license, e.g. deed.zh diff --git a/i18n/en-us.toml b/i18n/en-us.toml index f7908fb..bde84b6 100644 --- a/i18n/en-us.toml +++ b/i18n/en-us.toml @@ -8,6 +8,10 @@ other = "Categories" [SiteTagsTitle] other = "Tags" +[TableOfContents] + other = "TOC" +[SiteInfo] + other = "Site Info" [RSSTitle] other = "RSS Subscribe" [CCLinkTitle] diff --git a/i18n/zh-cn.toml b/i18n/zh-cn.toml index 7f03e2f..cab45a5 100644 --- a/i18n/zh-cn.toml +++ b/i18n/zh-cn.toml @@ -8,6 +8,10 @@ other = "分类" [SiteTagsTitle] other = "标签" +[TableOfContents] + other = "文章目录" +[SiteInfo] + other = "站点概览" [RSSTitle] other = "RSS 订阅" [CCLinkTitle] diff --git a/layouts/partials/header.html b/layouts/partials/header.html index ca2a735..ce3c63a 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -34,69 +34,5 @@ - +{{ partial "header/sidebar.html" . }} \ No newline at end of file diff --git a/layouts/partials/header/sidebar.html b/layouts/partials/header/sidebar.html new file mode 100644 index 0000000..a6621da --- /dev/null +++ b/layouts/partials/header/sidebar.html @@ -0,0 +1,66 @@ +{{- $SP := .Site.Params -}} + \ No newline at end of file