Welcome to mirror list, hosted at ThFree Co, Russian Federation.

post-copyright.html « components « partials « layouts - github.com/reuixiy/hugo-theme-meme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 01415091a9c6299442e227cedc9cf81a602d9403 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{{ 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 }}
                {{ $decodedBaseURL := (printf `%s://%s` $url.Scheme $url.Host) }}
                {{ $decodedPath := $url.Path }}
                {{ $decodedPermalink := (printf `%s%s` $decodedBaseURL $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 }}