🏗️ Finish post copy right widget coding.
This commit is contained in:
32
layouts/partials/post/post_copyright.html
Normal file
32
layouts/partials/post/post_copyright.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{{- if .Site.Params.creativeCommons.post }}
|
||||
<div class="post-copyright">
|
||||
<img src="/imgs/cc/cc.svg" width="75" height="75" align="right" />
|
||||
<ul>
|
||||
<li class="post-copyright-author">
|
||||
{{- if isset .Params "author" }}
|
||||
<strong>{{ print (T "PostCROriginAuthor") (T "SymbolColon") }} </strong>
|
||||
{{ .Params.Author }}
|
||||
{{- else }}
|
||||
<strong>{{ print (T "PostCRAuthor") (T "SymbolColon") }} </strong>
|
||||
{{ .Site.Params.author }}
|
||||
{{- end }}
|
||||
</li>
|
||||
<li class="post-copyright-link">
|
||||
{{- if isset .Params "originlink" }}
|
||||
<strong>{{ print (T "PostCROriginLink") (T "SymbolColon") }} </strong>
|
||||
<a target="_blank" href="{{ .Params.OriginLink }}" title="{{ .Title }}">{{ .Params.OriginLink }}</a>
|
||||
{{- else }}
|
||||
<strong>{{ print (T "PostCRLink") (T "SymbolColon") }}</strong>
|
||||
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Permalink }}</a>
|
||||
{{- end }}
|
||||
</li>
|
||||
<li class="post-copyright-license">
|
||||
<strong>{{ print (T "PostCRLink") (T "SymbolColon") }} </strong>
|
||||
{{- $ccText := .Site.Params.creativeCommons.license | upper }}
|
||||
{{- $lang := .Scratch.Get "lang" }}
|
||||
{{- $ccLink := printf "<a target='_blank' href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.%s'>%s</a>" (substr $lang 0 2) $ccText }}
|
||||
{{ printf (T "PostCRLicenseContent") $ccLink | safeHTML }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user