-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: render minimal-footer-about only if it exists
- Loading branch information
Showing
1 changed file
with
32 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,34 @@ | ||
{{ if and .Site.Params.enableAboutPageMinimalFooter (eq .Section "about") }} | ||
<footer class="minimal-footer-about"> | ||
{{ with .Site.Menus.socials }} | ||
<div class="about-socials"> | ||
{{ $length := sub (len .) 1 }} | ||
{{ range $index, $value := . }} | ||
{{- $linkType := (string .Pre) -}} | ||
{{- $iconName := (string .Post) -}} | ||
{{- $icon := (index $.Site.Data.SVG $iconName) -}} | ||
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external noopener"{{ end }}>{{ replace $icon "icon" (printf `icon %s` .Identifier) | safeHTML }}{{ .Name }}</a> | ||
{{- if lt $index $length -}} | ||
{{- print " " -}} | ||
{{- end -}} | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
{{ with .Site.Menus.links }} | ||
<div class="about-links"> | ||
{{ $length := sub (len .) 1 }} | ||
{{ range $index, $value := . }} | ||
{{- $linkType := (string .Pre) -}} | ||
{{- $iconName := (string .Post) -}} | ||
{{- $icon := (index $.Site.Data.SVG $iconName) -}} | ||
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external noopener"{{ end }}>{{ replace $icon "icon" (printf `icon %s` .Identifier) | safeHTML }}{{ .Name }}</a> | ||
{{- if lt $index $length -}} | ||
{{- print " " -}} | ||
{{- end -}} | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
</footer> | ||
{{ with or .Site.Menus.socials .Site.Menus.links }} | ||
<footer class="minimal-footer-about"> | ||
{{ with $.Site.Menus.socials }} | ||
<div class="about-socials"> | ||
{{ $length := sub (len .) 1 }} | ||
{{ range $index, $value := . }} | ||
{{- $linkType := (string .Pre) -}} | ||
{{- $iconName := (string .Post) -}} | ||
{{- $icon := (index $.Site.Data.SVG $iconName) -}} | ||
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external noopener"{{ end }}>{{ replace $icon "icon" (printf `icon %s` .Identifier) | safeHTML }}{{ .Name }}</a> | ||
{{- if lt $index $length -}} | ||
{{- print " " -}} | ||
{{- end -}} | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
{{ with $.Site.Menus.links }} | ||
<div class="about-links"> | ||
{{ $length := sub (len .) 1 }} | ||
{{ range $index, $value := . }} | ||
{{- $linkType := (string .Pre) -}} | ||
{{- $iconName := (string .Post) -}} | ||
{{- $icon := (index $.Site.Data.SVG $iconName) -}} | ||
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external noopener"{{ end }}>{{ replace $icon "icon" (printf `icon %s` .Identifier) | safeHTML }}{{ .Name }}</a> | ||
{{- if lt $index $length -}} | ||
{{- print " " -}} | ||
{{- end -}} | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
</footer> | ||
{{ end }} | ||
{{ end }} |