Skip to content

Commit

Permalink
fix: render minimal-footer-about only if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
reuixiy committed Feb 6, 2020
1 parent 76018fb commit 3be7996
Showing 1 changed file with 32 additions and 30 deletions.
62 changes: 32 additions & 30 deletions layouts/partials/minimal-footer-about.html
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 }}

0 comments on commit 3be7996

Please sign in to comment.