diff options
author | Michal Hrusecky <michal@hrusecky.net> | 2020-10-30 01:46:44 +0300 |
---|---|---|
committer | Michal Hrusecky <michal@hrusecky.net> | 2020-10-30 01:46:44 +0300 |
commit | 65c85cb6d918f7d01c3ab03f2995517215e4fc5e (patch) | |
tree | 9a22df742d3f9827410d81878cc5ce867c0679e9 | |
parent | 3fe12307f52221c030b5a430909067160547456a (diff) |
Make copyright configurable through Site config
-rw-r--r-- | exampleSite/config.yml | 2 | ||||
-rw-r--r-- | layouts/partials/post/copyright.html | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/exampleSite/config.yml b/exampleSite/config.yml index dfaf0a5..123d74a 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -1,6 +1,7 @@ baseURL: https://example.com/ theme: pure title: Pure theme for Hugo +copyright: CC BY 4.0 CN defaultContentLanguage: en # en/zh/... footnoteReturnLinkContents: ↩ hasCJKLanguage: true @@ -67,6 +68,7 @@ params: since: 2017 dateFormatToUse: "2006-01-02" enablePostCopyright: true + copyright_link: http://creativecommons.org/licenses/by/4.0/deed.zh # the directory under content folder that you want to render mainSections: ["posts"] # Enable/Disable menu icons diff --git a/layouts/partials/post/copyright.html b/layouts/partials/post/copyright.html index e7f47ee..60495f9 100644 --- a/layouts/partials/post/copyright.html +++ b/layouts/partials/post/copyright.html @@ -6,7 +6,12 @@ <a href="{{- .Permalink }}" title="{{- .Title }}" target="_blank" rel="external">{{- .Permalink }}</a> </li> <li class="post-copyright-license"> - <strong>{{ T "copyright_license" }}:</strong><a href="http://creativecommons.org/licenses/by/4.0/deed.zh" target="_blank" rel="external">CC BY 4.0 CN</a> + <strong>{{ T "copyright_license" }}: </strong> +{{- if .Site.Params.copyright_link }} + <a href="{{- .Site.Params.copyright_link }}" target="_blank" rel="external">{{ .Site.Copyright }}</a> +{{- else }} + {{ .Site.Copyright }} +{{- end }} </li> </ul> </blockquote> @@ -28,4 +33,4 @@ </div> </div> {{- end }} -{{- end }}
\ No newline at end of file +{{- end }} |