| 1 |
<!-- This is a copy of Docsy's footer, with the following changes: --> |
| 2 |
<!-- - added a sponsor bar on top of the footer --> |
| 3 |
<!-- - removed target=_blank from external links --> |
| 4 |
<!-- - add support for multiple copyright notices --> |
| 5 |
<!-- - align footer text on the left --> |
| 6 |
<!-- - remove icons/links from footer --> |
| 7 |
|
| 8 |
|
| 9 |
{{ define "partials/sponsor-logo-resize" }} |
| 10 |
{{- if gt .img.Width .width -}} |
| 11 |
{{- $rimg := .img.Resize (printf "%dx" .width) -}} |
| 12 |
{{- $rimg.RelPermalink }} {{ $rimg.Width -}}w, |
| 13 |
{{- end -}} |
| 14 |
{{ end }} |
| 15 |
|
| 16 |
{{ define "partials/sponsor-logo" }} |
| 17 |
{{ $img := resources.Get .logo }} |
| 18 |
|
| 19 |
<div class="sponsor"> |
| 20 |
<a href="{{ .url }}" > |
| 21 |
<!-- We'd prefer using $img.ResourceType, but that seems to be "image" even when it's a "genericResource" --> |
| 22 |
<img |
| 23 |
alt="Logo of {{ .name }}" |
| 24 |
title="{{ .name }}" |
| 25 |
importance="low" |
| 26 |
src="{{ $img.RelPermalink }}" |
| 27 |
{{ if eq $img.MediaType.String "image/webp" }} |
| 28 |
srcset="{{ $img.RelPermalink }} {{ $img.Width }}w, |
| 29 |
{{ partial "partials/sponsor-logo-resize" (dict "img" $img "width" 1200) }} |
| 30 |
{{ partial "partials/sponsor-logo-resize" (dict "img" $img "width" 800) }} |
| 31 |
{{ partial "partials/sponsor-logo-resize" (dict "img" $img "width" 400) }} |
| 32 |
{{ partial "partials/sponsor-logo-resize" (dict "img" $img "width" 200) }} |
| 33 |
{{ partial "partials/sponsor-logo-resize" (dict "img" $img "width" 100) }} |
| 34 |
{{ partial "partials/sponsor-logo-resize" (dict "img" $img "width" 50) }}" |
| 35 |
sizes="160px" |
| 36 |
{{ else }} |
| 37 |
data-foo="{{$img.MediaType}}" |
| 38 |
{{ end }} |
| 39 |
> |
| 40 |
</a> |
| 41 |
</div> |
| 42 |
{{ end }} |
| 43 |
|
| 44 |
|
| 45 |
{{ with $sponsors := $.Site.Data.sponsors.sponsors }} |
| 46 |
<section id="sponsors-bar" class="row td-box td-box--gradient td-box--height-auto d-print-none"> |
| 47 |
<h1 class="text-center col-12"><a href="/sponsors">Sponsors</a></h1> |
| 48 |
<div class="row section" style="margin-left: auto; margin-right: auto;"> |
| 49 |
<div class="row align-items-center justify-content-center h-100"> |
| 50 |
{{ range $sponsor := sort $sponsors "name" "asc" }} |
| 51 |
{{ if $sponsor.enabled }} |
| 52 |
{{ partial "sponsor-logo" (dict "name" $sponsor.name "url" $sponsor.url "logo" $sponsor.logo) }} |
| 53 |
{{ end }} |
| 54 |
{{ end }} |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
</section> |
| 58 |
{{ end }} |
| 59 |
|
| 60 |
{{ $links := .Site.Params.links }} |
| 61 |
<footer class="bg-dark py-5 row d-print-none"> |
| 62 |
<div class="container-fluid mx-sm-5"> |
| 63 |
<div class="row"> |
| 64 |
<div class="col-12"> |
| 65 |
{{ range $cp := .Site.Data.copyrights.copyrights }} |
| 66 |
<small class="text-white">{{ $cp | safeHTML }}</small><br> |
| 67 |
{{ end }} |
| 68 |
{{ with .Site.Params.privacy_policy }}<small class="ml-1"><a href="{{ . }}">{{ T "footer_privacy_policy" }}</a></small>{{ end }} |
| 69 |
{{ if not .Site.Params.ui.footer_about_disable }} |
| 70 |
{{ with .Site.GetPage "about" }}<p class="mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>{{ end }} |
| 71 |
{{ end }} |
| 72 |
</div> |
| 73 |
</div> |
| 74 |
</div> |
| 75 |
</footer> |
| 76 |
{{ define "footer-links-block" }} |
| 77 |
<ul class="list-inline mb-0"> |
| 78 |
{{ range . }} |
| 79 |
<li class="list-inline-item mx-2 h3" data-toggle="tooltip" data-placement="top" title="{{ .name }}" aria-label="{{ .name }}"> |
| 80 |
<a class="text-white" href="{{ .url }}" aria-label="{{ .name }}"> |
| 81 |
<i class="{{ .icon }}"></i> |
| 82 |
</a> |
| 83 |
</li> |
| 84 |
{{ end }} |
| 85 |
</ul> |
| 86 |
{{ end }} |