fix social order
This commit is contained in:
parent
bc5b6b4e94
commit
d823d5cd5f
3 changed files with 10 additions and 10 deletions
|
@ -1,9 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
{{ $social := slice "twitter" "github" "instagram" }}<!---->
|
||||
{{ range $key, $val := site.Params }}<!---->
|
||||
{{ if in $social $key }}<!---->
|
||||
{{ $.Scratch.SetInMap "social-map" $key $val }}<!---->
|
||||
{{ range $social }}<!---->
|
||||
{{ if isset site.Params . }}<!---->
|
||||
{{ $.Scratch.Add "social-list" (slice .) }}<!---->
|
||||
{{ end }}<!---->
|
||||
{{ end }}<!---->
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
<!-- Preload -->
|
||||
<link rel="preload" as="image" href="{{ `theme.png` | absURL }}" />
|
||||
|
||||
{{ range $key, $val := $.Scratch.Get "social-map" }}
|
||||
<link rel="preload" as="image" href="{{ printf `%s.svg` $key | absURL }}" />
|
||||
{{ range $.Scratch.Get "social-list" }}
|
||||
<link rel="preload" as="image" href="{{ printf `%s.svg` . | absURL }}" />
|
||||
{{ end }}
|
||||
|
||||
<!-- Favicon -->
|
||||
|
|
|
@ -45,13 +45,13 @@
|
|||
</nav>
|
||||
{{ end }}<!---->
|
||||
|
||||
{{ with $.Scratch.Get "social-map" }}
|
||||
{{ with $.Scratch.Get "social-list" }}
|
||||
<nav class="social">
|
||||
{{ range $key, $val := . }}
|
||||
{{ range . }}
|
||||
<a
|
||||
class="{{ $key }}"
|
||||
style="--url: url(./{{ printf `%s.svg` $key }})"
|
||||
href="https://{{ $key }}.com/{{ $val }}"
|
||||
class="{{ . }}"
|
||||
style="--url: url(./{{ . }}.svg)"
|
||||
href="https://{{ . }}.com/{{ site.Params.Get . }}"
|
||||
target="_blank"
|
||||
></a>
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue