This commits change the way contacts params are handled: instead of
declaring them statically, they are declared as an array of tables in
the TOML configuration file, then they are displayed in the two sections
(homepage and footer) of the website through the {{ range }} statement.
This makes handling multiple contacts params easier and avoids the
need of changing manually this two files:
- `layouts/partials/footer.html`;
- `exampleSite/content/homepage/contact.md`;
Signed-off-by: Filippo Fontana <filippofontana1998@gmail.com>
50 lines
1.5 KiB
HTML
50 lines
1.5 KiB
HTML
{{ $headless := .Site.GetPage "/homepage" }}
|
|
{{ $sections := $headless.Resources.ByType "page" }}
|
|
{{ $sections := cond .Site.BuildDrafts $sections (where $sections "Draft" "==" false) }}
|
|
|
|
<footer class="site-footer">
|
|
<div class="inner">
|
|
{{ if ne .Site.Params.footer.showFooterLinks false }}
|
|
<section class="links">
|
|
<ol>
|
|
{{ range where $sections ".Params.footer_menu" "eq" true }}
|
|
<li>
|
|
<a href="{{ .Params.detailed_page_path }}">{{ .Params.footer_menu_title }}</a>
|
|
</li>
|
|
{{ end }}
|
|
</ol>
|
|
</section>
|
|
<hr />
|
|
{{ end }}
|
|
|
|
{{ if ne .Site.Params.footer.showContactIcons false }}
|
|
<section class="icons">
|
|
<ol>
|
|
{{ range .Site.Params.contacts }}
|
|
<li>
|
|
<a href="{{ .url }}" aria-label='{{ i18n "{{ .label }}" }}'><i class="{{ .icon }}"></i></a>
|
|
</li>
|
|
{{ end }}
|
|
</ol>
|
|
</section>
|
|
{{ end }}
|
|
|
|
{{ with .Site.Params.copyright }}
|
|
<section class="copyright">{{ . | safeHTML }}</section>
|
|
{{ end }}
|
|
|
|
{{ if ne .Site.Params.hidedesignbyline true }}
|
|
<section>
|
|
<a href="https://themes.gohugo.io/hugo-scroll/" target="_blank" rel="noopener">Hugo Scroll</a> template
|
|
</section>
|
|
{{ end }}
|
|
|
|
{{ if ne .Params.enableGitInfo false }}
|
|
{{- if $.GitInfo -}}
|
|
<section>
|
|
version: {{ .Lastmod.Format "2006-01-02" }} | #{{ .GitInfo.AbbreviatedHash }}
|
|
</section>
|
|
{{- end -}}
|
|
{{ end }}
|
|
</div>
|
|
</footer>
|