-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfooter.html
More file actions
118 lines (109 loc) · 4.87 KB
/
footer.html
File metadata and controls
118 lines (109 loc) · 4.87 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{{/* (C) 2023 GoodData Corporation */}}
{{ $footer := getJSON "https://www.gooddata.com/learn-assets/js/footer-definition.json" }}
{{ if not .Site.Params.whitelabeled }}
<footer class="gd-footer" aria-label="Page footer">
<a href="#top" class="skip-link skip-link--footer">Skip footer content</a>
{{ if $footer.footer.bannerLinks }}
<ul class="gd-footer-banner-links gd-footer-links">
{{ range $index, $link := $footer.footer.bannerLinks }}
<li class="gd-footer-banner-links-item gd-footer-links-item">
<input
type="checkbox"
tabindex="-1"
id="gd-footer-banner-links-item-trigger-{{ $index }}"
name="gd-footer-banner-links-item-trigger-{{ $index }}"
class="gd-footer-banner-links-item-trigger gd-footer-links-item-trigger"
/>
<label
for="gd-footer-banner-links-item-trigger-{{ $index }}"
class="gd-footer-banner-links-item-text gd-footer-links-item-text"
>
{{ $link.title }}
</label>
{{ if and $link.items (gt (len $link.items) 0) }}
<ul class="gd-footer-banner-sublinks gd-footer-sublinks">
{{ range $sublink := $link.items }}
<li class="gd-footer-banner-sublinks-item gd-footer-sublinks-item">
{{ if and $sublink.link $sublink.title }}
{{ template "absolute-link" (dict "url" $sublink.link "text" $sublink.title "class" "gd-footer-sublinks-item-link" "idPrefix" "footer-link-") }}
{{ else }}
<span class="gd-footer-sublinks-item-link"> </span>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
<ul class="gd-footer-links">
{{ range $index, $link := $footer.footer.links }}
<li class="gd-footer-links-item">
<input
type="checkbox"
tabindex="-1"
id="gd-footer-links-item-trigger-{{ $index }}"
name="gd-footer-links-item-trigger-{{ $index }}"
class="gd-footer-links-item-trigger"
/>
<label
for="gd-footer-links-item-trigger-{{ $index }}"
class="gd-footer-links-item-text"
>
{{ $link.title }}
</label>
{{ if and $link.items (gt (len $link.items) 0) }}
<ul class="gd-footer-sublinks">
{{ range $sublink := $link.items }}
<li class="gd-footer-sublinks-item">
{{ if and $sublink.link $sublink.title }}
{{ template "absolute-link" (dict "url" $sublink.link "text" $sublink.title "class" "gd-footer-sublinks-item-link" "idPrefix" "footer-link-") }}
{{ else }}
<span class="gd-footer-sublinks-item-link"> </span>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
<div class="gd-footer-bottom">
{{ template "footer-buttons" (dict "footer" $footer.footer "class" "d-lg-none") }}
{{ if $footer.footer.copyright }}
<div class="gd-footer-copyright">
{{ range $copy := $footer.footer.copyright }}
<div class="gd-footer-copyright-text">
{{ if $copy.link }}
{{ template "absolute-link" (dict "url" $copy.link "text" $copy.text "class" "gd-footer-copyright-link" "idPrefix" "footer-copyright-") }}
{{ else }}
{{ $copy.text }}
{{ end }}
</div>
{{ end }}
</div>
{{ end }}
{{ template "footer-buttons" (dict "footer" $footer.footer "class" "d-none d-lg-flex") }}
</footer>
{{ end }}
{{ define "footer-buttons" }}
{{ if .footer.buttons }}
<div class="gd-footer-buttons{{ if .class }} {{ .class }}{{ end }}">
{{ range $button := .footer.buttons }}
{{ if eq $button.type "social" }}
{{ template "absolute-link" (dict "url" $button.link "text" $button.text "icon" ($button.icon | safeHTML) "class" "gd-footer-buttons-item gd-footer-buttons-item-icon-button" "idPrefix" "footer-btn-" "rel" "noreferrer noopener") }}
{{ else if eq $button.type "secondary" }}
{{ template "absolute-link" (dict "url" $button.link "text" $button.text "class" "gd-footer-buttons-item button button-secondary button-small button-inverted" "idPrefix" "footer-btn-") }}
{{ end }}
{{ end }}
</div>
{{ end }}
{{ end }}
{{ define "absolute-link" }}
{{ $urlParse := urls.Parse .url }}
{{ $url := print (cond (and (gt (len $urlParse.Path) 0) (eq (len $urlParse.Host) 0)) "https://www.gooddata.com" "") .url }}
{{ $id := replace (lower .text) " " "-" }}
{{ $content := cond (isset . "icon") .icon .text }}
<a href="{{ $url }}" class="{{ .class }}" id="{{ .idPrefix }}{{ $id }}" target="_blank" {{ if (isset . "rel") }}rel="{{ .rel }}"{{ end }} aria-label="{{ $id }}">{{ $content }}</a>
{{ end }}