diff options
author | Zhao XiaoHei <xiaohei.zyx@gmail.com> | 2019-11-21 09:34:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-21 09:34:27 +0300 |
commit | 7ce39ce4d285d2793e212508546e5c4084072186 (patch) | |
tree | c93e4b2aa0bb3fe8c36ba85242b4cb4b02b43596 | |
parent | 95f1e14e9a96d69d9b75fa90448ca5246fdbf0b1 (diff) | |
parent | 96bab9bd4e64d95fd93ce9a484b67c804609c8ae (diff) |
Merge pull request #29 from xiaoheiAh/fix-copyright
fix copyright hardcode
-rw-r--r-- | exampleSite/config.yml | 2 | ||||
-rw-r--r-- | i18n/en.yaml | 4 | ||||
-rw-r--r-- | i18n/zh.yaml | 5 | ||||
-rw-r--r-- | layouts/partials/article.html | 2 | ||||
-rw-r--r-- | layouts/partials/post/copyright.html | 6 |
5 files changed, 14 insertions, 5 deletions
diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 18420c6..8eef3df 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -65,7 +65,7 @@ menu: params: since: 2017 dateFormatToUse: "2006-01-02" - enablePostCopyright: false + enablePostCopyright: true # the directory under content folder that you want to render mainSections: ["posts"] # Enable/Disable menu icons diff --git a/i18n/en.yaml b/i18n/en.yaml index 5434065..34c4cb6 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -144,6 +144,10 @@ copyright_base_on: other: base on copyright_powered_by: other: Powered by +copyright_post: + other: Permalink +copyright_license: + other: License insight_hint: other: Type something... diff --git a/i18n/zh.yaml b/i18n/zh.yaml index 22412df..364740b 100644 --- a/i18n/zh.yaml +++ b/i18n/zh.yaml @@ -149,6 +149,11 @@ copyright_base_on: copyright_powered_by: other: Powered by +copyright_post: + other: 本文链接 +copyright_license: + other: License + insight_hint: other: 想要查找什么... diff --git a/layouts/partials/article.html b/layouts/partials/article.html index 7967a9a..2706403 100644 --- a/layouts/partials/article.html +++ b/layouts/partials/article.html @@ -22,11 +22,9 @@ <div class="article-entry marked-body" itemprop="articleBody"> {{ .Content }} </div> - {{- with .Site.Params.enablePostCopyright }} <div class="article-footer"> {{- partial "post/copyright.html" . }} </div> - {{- end }} </article> {{- partial "post/comment.html" . }} </div> diff --git a/layouts/partials/post/copyright.html b/layouts/partials/post/copyright.html index 17af13f..e7f47ee 100644 --- a/layouts/partials/post/copyright.html +++ b/layouts/partials/post/copyright.html @@ -1,11 +1,12 @@ +{{- if .Site.Params.enablePostCopyright }} <blockquote class="mt-2x"> <ul class="post-copyright list-unstyled"> <li class="post-copyright-link hidden-xs"> - <strong>本文链接:</strong> + <strong>{{ T "copyright_post" }}: </strong> <a href="{{- .Permalink }}" title="{{- .Title }}" target="_blank" rel="external">{{- .Permalink }}</a> </li> <li class="post-copyright-license"> - <strong>版权声明: </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><a href="http://creativecommons.org/licenses/by/4.0/deed.zh" target="_blank" rel="external">CC BY 4.0 CN</a> </li> </ul> </blockquote> @@ -27,3 +28,4 @@ </div> </div> {{- end }} +{{- end }}
\ No newline at end of file |