InkSoul/themes/meme_cdn/layouts/partials/components/post-copyright.html

30 lines
2.0 KiB
HTML

{{ if and .Site.Params.enablePostCopyright (.Params.displayCopyright | default .Site.Params.displayPostCopyright) }}
{{ $author := partial "utils/author.html" . }}
{{ with $author.name }}
<ul class="post-copyright">
<li class="copyright-item author">
{{- with $author.website -}}
<span class="copyright-item-text">{{ i18n "copyrightAuthor" }}</span>{{ i18n "colon" }}<a href="{{ . }}" class="p-author h-card" target="_blank" rel="noopener">{{ $author.name }}</a>
{{- else -}}
<span class="copyright-item-text">{{ i18n "copyrightAuthor" }}</span>{{ i18n "colon" }}<span class="p-author h-card">{{ $author.name }}</span>
{{- end -}}
</li>
{{ if $.Params.original | default $.Site.Params.original }}
{{ $url := urls.Parse $.Permalink }}
{{ $decodedPath := $url.Path }}
{{ $baseURLWithLangFix := (strings.TrimSuffix "/" (print `/` | absLangURL)) }}
{{ $decodedPermalink := (printf `%s%s` $baseURLWithLangFix $decodedPath) }}
<li class="copyright-item link"><span class="copyright-item-text">{{ i18n "copyrightLink" }}</span>{{ i18n "colon" }}<a href="{{ $.RelPermalink }}" target="_blank" rel="noopener">{{ $decodedPermalink }}</a></li>
{{ else }}
{{ with $.Params.link }}
<li class="copyright-item link"><span class="copyright-item-text">{{ i18n "copyrightLink" }}</span>{{ i18n "colon" }}<a href="{{ . }}" target="_blank" rel="noopener">{{ . }}</a></li>
{{ end }}
{{ end }}
{{ with $author.copyright }}
{{- $raw := . -}}
<li class="copyright-item license"><span class="copyright-item-text">{{ i18n "copyrightLicense" }}</span>{{ i18n "colon" }}{{ partial "utils/markdownify.html" (dict "$" $ "raw" $raw "isContent" false) }}</li>
{{ end }}
</ul>
{{ end }}
{{ end }}