blob: e0f6670be64b4a07f7b07116de4aa86a8c93fa2b (
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
30
31
32
33
34
35
36
37
38
39
40
41
|
{{ $classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l " }}
{{ $gtag := .gtag | default "unknown" }}
{{ $classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l " }}
{{ $gtag := .gtag | default "unknown" }}
{{ $utmSource := cond (eq $gtag "footer") "hugofooter" "hugohome" }}
{{ with .cx.Site.Data.sponsors }}
<section
class="{{ $.classes_section | default "bg-primary-color-dark b--dark-gray bb bt ph5 pv4 w-100" }}">
<div class="center mw9">
<h3 class="b f3 mv0 light-gray">Hugo Sponsors</h3>
<div class="flex-ns flex-wrap center justify-between pt3">
{{ range .banners }}
<div
class="{{ $classes_box }} o-100"
{{ with .bgcolor }}style="background-color: {{ . }};"{{ end }}>
{{ $url := printf "%s?%s" .link (querify "utm_source" $utmSource "utm_medium" "banner" "utm_campaign" (.utm_campaign | default "hugosponsor")) | safeURL }}
{{ if eq (getenv "HUGO_ENV") "production" | or (eq $.cx.Site.Params.env "production") }}
{{ $gtagID := printf "Sponsor %s %s" .name $gtag | title }}
<a
href="{{ $url }}"
onclick="trackOutboundLink({{ printf "'%s', '%s'" $gtagID $url | safeJS }});"
class="grow">
<img
src="{{ .logo }}"
alt="Logo for {{ .name }}"
class="img h3 center" />
</a>
{{ else }}
<a href="{{ $url }}" class="grow">
<img
src="{{ .logo }}"
alt="Logo for {{ .name }}"
class="img h3 center"
/></a>
{{ end }}
</div>
{{ end }}
</div>
</div>
</section>
{{ end }}
|