Statically define the social icons

This commit is contained in:
Eryn Wells 2021-10-10 19:58:55 -07:00
parent 045908410a
commit d4b977b1ee
3 changed files with 9 additions and 21 deletions

View file

@ -1,13 +1,4 @@
<!DOCTYPE html>
{{ $.Scratch.Delete "social-list" }}<!---->
{{ $social := slice "twitter" "github" "instagram" }}<!---->
{{ range $social }}<!---->
{{ if isset site.Params . }}<!---->
{{ $.Scratch.Add "social-list" (slice .) }}<!---->
{{ end }}<!---->
{{ end }}<!---->
<html lang="{{ site.LanguageCode }}">
{{ partial "head.html" . }}

View file

@ -17,9 +17,7 @@
<!-- Styles & Scripts -->
{{ $app_css := resources.Get "app.css" }}
<!---->
{{ $custom_css := resources.Get "style.css" }}
<!---->
{{ $css := slice $app_css $custom_css | resources.Concat "app.css" | minify }}
<link rel="preload stylesheet" as="style" href="{{ $css.Permalink }}" />

View file

@ -12,16 +12,15 @@
</nav>
{{ end }}<!---->
{{ with $.Scratch.Get "social-list" }}
<nav class="social">
{{ range . }}
<a
class="{{ . }}"
style="--url: url(./{{ . }}.svg)"
href="https://{{ . }}.com/{{ site.Params.Get . }}"
target="_blank"
></a>
{{ end }}
<a style="--url: url(./twitter.svg)"
href="https://twitter.com/erynofwales"
target="_blank"><span>tw</span></a>
<a style="--url: url(./github.svg)"
href="https://github.com/erynofwales"
target="_blank"><span>gh</span></a>
<a style="--url: url(./instagram.svg)"
href="https://instagram.com/erynofwales"
target="_blank"><span>ig</span></a>
</nav>
{{ end }}
</header>