diff options
| author | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-01-31 22:39:16 +0800 | 
|---|---|---|
| committer | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-01-31 22:39:16 +0800 | 
| commit | a6e116452f8d3f0e043107a1e0d047256514457b (patch) | |
| tree | 187ecacd6d3b4b77cedbd4d78d4a1a08d99e1531 | |
| parent | 7a5ee0ce2555bc1dca209ae903b86eb7b658cdb6 (diff) | |
feat: add `postMetaInFooter` param
add `postMetaInFooter` param to control the `contentCopyright` container, and now you can show the author and lastMod information without displaying the license.
| -rw-r--r-- | archetypes/default.md | 1 | ||||
| -rw-r--r-- | exampleSite/config.toml | 5 | ||||
| -rw-r--r-- | layouts/partials/post/copyright.html | 4 | 
3 files changed, 7 insertions, 3 deletions
| diff --git a/archetypes/default.md b/archetypes/default.md index 5a49b9e..79e85b3 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -14,6 +14,7 @@ author: ""  comment: false  toc: false  autoCollapseToc: false +postMetaInFooter: false  # You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."  contentCopyright: false  reward: false diff --git a/exampleSite/config.toml b/exampleSite/config.toml index cabab6b..d5691a4 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -67,9 +67,10 @@ copyright = ""            # default: author.name ↓        # 默认为下面配    fancybox = true           # see https://github.com/fancyapps/fancybox                 # 是否启用fancybox(图片可点击)    mathjax = false           # see https://www.mathjax.org/                              # 是否使用mathjax(数学公式)    mathjaxEnableSingleDollar = false                                                     # 是否使用 $...$ 即可進行inline latex渲染 -  linkToMarkDown = false    # if you config contentCopyright and hugo output .md files. # 是否在链接到markdown原始文件(如果你配置了下面的许可协议并允许hugo生成markdown文件) -  contentCopyright = '<a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a>' +  postMetaInFooter = true   # contain author, lastMod, markdown link, license           # 包含作者,上次修改时间,markdown链接,许可信息 +  linkToMarkDown = false    # Only effective when hugo will output .md files.           # 链接到markdown原始文件(仅当允许hugo生成markdown文件时有效) +  contentCopyright = ''     # e.g. '<a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a>'    changyanAppid = ""        # Changyan app id             # 畅言    changyanAppkey = ""       # Changyan app key diff --git a/layouts/partials/post/copyright.html b/layouts/partials/post/copyright.html index 71494d0..cd42d68 100644 --- a/layouts/partials/post/copyright.html +++ b/layouts/partials/post/copyright.html @@ -1,4 +1,4 @@ -{{ if or .Params.contentCopyright (and .Site.Params.contentCopyright (ne .Params.contentCopyright false)) }} +{{ if or .Params.postMetaInFooter (and .Site.Params.postMetaInFooter (ne .Params.postMetaInFooter false)) -}}  <div class="post-copyright">    <p class="copyright-item">      <span class="item-title">{{ T "author" }}</span> @@ -16,6 +16,7 @@      </p>      {{- end }}    {{- end }} +  {{ if or .Params.contentCopyright (and .Site.Params.contentCopyright (ne .Params.contentCopyright false)) -}}    <p class="copyright-item">      <span class="item-title">{{ T "license" }}</span>      <span class="item-content"> @@ -26,5 +27,6 @@      {{- end -}}      </span>    </p> +  {{- end }}  </div>  {{- end }}
\ No newline at end of file | 
