From 7dda657d380dda6549f8fd33264c957c390be428 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Tue, 14 Apr 2020 11:44:50 +0800 Subject: Add post license --- archetypes/default.md | 1 + assets/sass/_list.scss | 9 ++++++++- exampleSite/config.toml | 12 ++++++++---- layouts/_default/single.html | 9 +++++++++ 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/archetypes/default.md b/archetypes/default.md index 0d11b0d..5f12156 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -3,4 +3,5 @@ title = "{{ replace .Name "-" " " | title }}" date = {{ .Date }} description = "" tags = [] +noLicense = false +++ diff --git a/assets/sass/_list.scss b/assets/sass/_list.scss index d9bad6e..57f9fe9 100644 --- a/assets/sass/_list.scss +++ b/assets/sass/_list.scss @@ -55,6 +55,13 @@ article { padding-bottom: 1.5em; } -#post-comment { +#license { + @include link-primary(); + + margin-bottom: 1.5em; +} + +// not show while iframe not loaded +#post-comment .utterances-frame { border-top: $spliter; } \ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 6dc23e1..6ba90df 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -18,12 +18,16 @@ paginate = 10 # Bangumi image chart id # bgmImageChart = "000000" + # License + license = "知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 (CC BY-NC-SA 4.0)" + licenseLink = "http://creativecommons.org/licenses/by-nc-sa/4.0/" + # Comments # utterances, see: https://utteranc.es/ - cdnUtterancesJS = "https://utteranc.es/client.js" - utterancesRepo = "[ENTER REPO HERE]" - utterancesIssueTerm = "pathname" - utterancesTheme = "github-light" + # cdnUtterancesJS = "https://utteranc.es/client.js" + # utterancesRepo = "[ENTER REPO HERE]" + # utterancesIssueTerm = "pathname" + # utterancesTheme = "github-light" # Custom lazyload thumbnail cdnLazyloadSRC = "https://cdn.jsdelivr.net/gh/amzrk2/poal-jsdelivr/lazyload/dsr_loading.svg" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index b21c511..0d564b0 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -14,7 +14,16 @@ {{ .Content }} + {{ if ne .Params.noLicense true }} +
+
+

除特殊注明部分,本作品采用 {{ .Site.Params.license }} 进行许可。

+
+
+ {{ end }} + {{ if .Site.Params.cdnUtterancesJS }} {{ partial "comment-utterances.html" . }} + {{ end }}