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.
This commit is contained in:
olOwOlo 2018-01-31 22:39:16 +08:00
parent 7a5ee0ce25
commit a6e116452f
No known key found for this signature in database
GPG key ID: 456394B6E7A15EA6
3 changed files with 7 additions and 3 deletions

View file

@ -14,6 +14,7 @@ author: ""
comment: false comment: false
toc: false toc: false
autoCollapseToc: false autoCollapseToc: false
postMetaInFooter: false
# You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright." # You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."
contentCopyright: false contentCopyright: false
reward: false reward: false

View file

@ -67,9 +67,10 @@ copyright = "" # default: author.name ↓ # 默认为下面配
fancybox = true # see https://github.com/fancyapps/fancybox # 是否启用fancybox图片可点击 fancybox = true # see https://github.com/fancyapps/fancybox # 是否启用fancybox图片可点击
mathjax = false # see https://www.mathjax.org/ # 是否使用mathjax数学公式 mathjax = false # see https://www.mathjax.org/ # 是否使用mathjax数学公式
mathjaxEnableSingleDollar = false # 是否使用 $...$ 即可進行inline latex渲染 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 # 畅言 changyanAppid = "" # Changyan app id # 畅言
changyanAppkey = "" # Changyan app key changyanAppkey = "" # Changyan app key

View file

@ -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"> <div class="post-copyright">
<p class="copyright-item"> <p class="copyright-item">
<span class="item-title">{{ T "author" }}</span> <span class="item-title">{{ T "author" }}</span>
@ -16,6 +16,7 @@
</p> </p>
{{- end }} {{- end }}
{{- end }} {{- end }}
{{ if or .Params.contentCopyright (and .Site.Params.contentCopyright (ne .Params.contentCopyright false)) -}}
<p class="copyright-item"> <p class="copyright-item">
<span class="item-title">{{ T "license" }}</span> <span class="item-title">{{ T "license" }}</span>
<span class="item-content"> <span class="item-content">
@ -26,5 +27,6 @@
{{- end -}} {{- end -}}
</span> </span>
</p> </p>
{{- end }}
</div> </div>
{{- end }} {{- end }}