hugo-theme-more-contentful/layouts/partials/footer.html
2022-11-22 19:45:45 +08:00

44 lines
1.4 KiB
HTML

<footer aria-label="Site footer">
<!-- A convenient back to top link. -->
<a href="#top">{{ i18n "back_to_top" | default "Back to top" }}</a>
<!-- Linking to other languages' homepage. -->
{{ if $.Site.IsMultiLingual }}
<p>{{ i18n "multilingual" }}:
<span class="list site__languages">
{{ range $.Site.Languages }}
<a href="{{ . | relURL }}" hreflang="{{ .Lang }}">{{ with .LanguageName }}{{ . }}{{ else }}{{ .Lang }}{{ end }}</a>
{{ end }}
</span>
</p>
{{ end }}
<!-- List all of the social media links -->
{{ with (index $.Site.Data "more-contentful").contacts }}
<ul class="list site__socials">
{{ $useImage := index . "useImage" | default false }}
{{ $links := sort .links "id" "asc" }}
{{ $links = sort $links "weight" "asc" }}
{{- range $links -}}
<li>
<a {{ if $useImage }}class="site__social-icon"{{ end }} rel="me" href="{{ .url | absLangURL }}" aria-label="{{ with .name }}{{ . }}{{ else }}{{ .id }}{{ end }}">
{{- if $useImage }}
{{- partial "components/icon.html" (dict "id" .id "output" "icons/brand/%s.svg" "template" "templates/simple-icon.svg") }}
{{- else }}
{{- .name }}
{{- end }}
</a>
</li>
{{- end -}}
</ul>
{{ end }}
{{ $markdownOpt := dict "markup" "markdown" }}
<!-- Copyright info. -->
<p>{{ with $.Site.Copyright }}{{ . | $.Site.RenderPage $markdownOpt }}{{ else }}© {{ now.Year }} {{ with $.Site.Author.name }}{{ . }}{{ else }}{{ $.Site.Title }}{{ end }}{{ end }}</p>
</footer>