blob: a20f226fff38c588dc89615fec8ed4a17dc5a2ff (
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
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
119
120
121
122
123
124
125
126
127
128
129
|
{{/* variables for enabling/disabling parts of the footer */}}
{{ $footerEnabled := site.Params.footer.enable | default true }}
{{ $navigationEnabled := site.Params.footer.navigation.enable | default true }}
{{ $contactMeEnabled := site.Params.footer.contactMe.enable | default true }}
{{ $newsletterEnabled := site.Params.footer.newsletter.enable | default true }}
{{ $credentialsEnabled := site.Params.footer.credentials.enable | default true }}
{{/* Keep backward compatibility for the newsletter function */}}
{{ if site.Params.newsletter.enable }}
{{ $newsletterEnabled = true }}
{{ end }}
{{ if $footerEnabled }}
{{ $author:= site.Data.author }}
{{ if (index site.Data site.Language.Lang).author }}
{{ $author = (index site.Data site.Language.Lang).author }}
{{ end }}
{{ $sections:= site.Data.sections }}
{{ if (index site.Data site.Language.Lang).sections }}
{{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }}
{{ $copyrightNotice := "© 2021 Copyright."}}
{{ if (index site.Data site.Language.Lang).site }}
{{ $siteConfig := (index site.Data site.Language.Lang).site }}
{{ if $siteConfig.copyright }}
{{ $copyrightNotice = $siteConfig.copyright }}
{{ end }}
{{ end }}
{{/* footer logos */}}
{{ $themeLogo := "/images/theme-logo.png" }}
{{ $hugoLogo := "/images/hugo-logo.svg" }}
{{/* resize the logos. don't resize svg because it is not supported */}}
{{ $themeLogo:= resources.Get $themeLogo}}
{{ if and $themeLogo (ne $themeLogo.MediaType.SubType "svg") }}
{{ $themeLogo = $themeLogo.Resize "32x" }}
{{ end }}
{{ $themeLogo = $themeLogo.RelPermalink}}
{{ $hugoLogo:= resources.Get $hugoLogo}}
{{ if and $hugoLogo (ne $hugoLogo.MediaType.SubType "svg")}}
{{ $hugoLogo = $hugoLogo.Resize "32x" }}
{{ end }}
{{ $hugoLogo = $hugoLogo.RelPermalink}}
<footer class="container-fluid text-center align-content-center footer pb-2">
<div class="container pt-5">
<div class="row text-left">
{{ if $navigationEnabled }}
<div class="col-md-4 col-sm-12">
<h5>{{ i18n "navigation" }}</h5>
{{ if $sections }}
<ul>
{{- range sort $sections "section.weight" }}
{{ if and (.section.enable) (.section.showOnNavbar)}}
{{ $sectionID := replace (lower .section.name) " " "-" }}
{{ if .section.id }}
{{ $sectionID = .section.id }}
{{ end }}
<li class="nav-item">
<a class="smooth-scroll" href="/#{{ $sectionID }}">{{ .section.name }}</a>
</li>
{{ end }}
{{- end }}
</ul>
{{ end }}
</div>
{{ end }}
{{ if (and $contactMeEnabled $author) }}
<div class="col-md-4 col-sm-12">
<h5>{{ i18n "contact_me" }}</h5>
<ul>
{{ range $key,$value:= $author.contactInfo }}
<li><span>{{ title $key }}: </span> <span>{{ $value }}</span></li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if $newsletterEnabled }}
<div class="col-md-4 col-sm-12">
<!-- <h5>Newsletter</h5> -->
<p>{{ i18n "newsletter_text" }}</p>
<form>
<div class="form-group">
<input
type="email"
class="form-control"
id="exampleInputEmail1"
aria-describedby="emailHelp"
placeholder="{{ i18n "newsletter_input_placeholder" }}"
/>
<small id="emailHelp" class="form-text text-muted"
>{{ i18n "newsletter_warning" }}</small
>
</div>
<button type="submit" class="btn btn-info">{{ i18n "submit" }}</button>
</form>
</div>
{{ end }}
</div>
</div>
{{ if $credentialsEnabled }}
<hr />
<div class="container">
<div class="row text-left">
<div class="col-md-4">
<a id="theme" href="https://github.com/hossainemruz/toha" target="_blank" rel="noopener">
<img src="{{ $themeLogo }}" alt="Toha Theme Logo">
Toha
</a>
</div>
<div class="col-md-4 text-center">{{ $copyrightNotice | markdownify }}</div>
<div class="col-md-4 text-right">
<a id="hugo" href="https://gohugo.io/" target="_blank" rel="noopener">{{ i18n "hugoAttributionText" }}
<img
src="{{ $hugoLogo }}"
alt="Hugo Logo"
height="18"
/>
</a>
</div>
</div>
</div>
{{ end }}
</footer>
{{end}}
|