Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/rmaguiar/hugo-theme-color-your-world.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Aguiar <rmaguiar@tuta.io>2022-03-16 19:05:34 +0300
committerRaphael Aguiar <rmaguiar@tuta.io>2022-03-16 19:05:34 +0300
commitb767c4e39893384d6821e357ba6d4c901a5eb9b7 (patch)
treed82c75e66f0b019ee10c942c848988cc16d282ed /layouts
parentb7927278b9d88d8f81ce385b74fb53f8048720aa (diff)
Bundle SVGs and a bunch of minor changes and fixes
* Bundle SVGs * Bump KaTeX from 0.15.2 to 0.15.3 * Use ESBuild conditionally (Hugo 0.74+) * A bunch of minor changes and fixes
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/_markup/render-heading.html8
-rw-r--r--layouts/_default/baseof.html39
-rw-r--r--layouts/_default/list.html10
-rw-r--r--layouts/_default/single.html4
-rw-r--r--layouts/index.html6
-rw-r--r--layouts/partials/content-svg.html10
-rw-r--r--layouts/partials/footer-opt.html11
-rw-r--r--layouts/partials/head-style.html2
-rw-r--r--layouts/partials/head.html10
-rw-r--r--layouts/partials/katex-font-preload.html2
-rw-r--r--layouts/partials/katex.html3
-rw-r--r--layouts/partials/pagination.html13
-rw-r--r--layouts/partials/processed-content.html5
-rw-r--r--layouts/partials/search-form.html6
-rw-r--r--layouts/shortcodes/gifoid.html9
-rw-r--r--layouts/shortcodes/social.html11
16 files changed, 60 insertions, 89 deletions
diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html
index 8608f38..221f169 100644
--- a/layouts/_default/_markup/render-heading.html
+++ b/layouts/_default/_markup/render-heading.html
@@ -5,13 +5,17 @@
TODO
It looks weird when the heading is also a link,
but then that's also true for links in ToCs
- Would like to test a few more things
+ Not sure how to deal with it
-->
+<!-- Get SVG bundle -->
+{{ $svgBundleLink := (.Page.Scratch.Get "svgBundle").RelPermalink }}
+
+
{{ $anchoredLinkLevels := seq 2 6 }}
{{ if in $anchoredLinkLevels .Level }}
- <h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ printf `<a class="anchor" href="#%s" title='%s: %s.'><svg aria-hidden="true"><use xlink:href="#hashtag"/></svg></a>` (.Anchor | safeURL) (T "anchorFor") (.Text | plainify | safeHTML) | safeHTML }} {{ .Text | safeHTML }}</h{{ .Level }}>
+ <h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ printf `<a class="anchor" href="#%s" title='%s: %s.'><svg aria-hidden="true"><use xlink:href="%s#hashtag"/></svg></a>` (.Anchor | safeURL) (T "anchorFor") (.Text | plainify | safeHTML) ($svgBundleLink) | safeHTML }} {{ .Text | safeHTML }}</h{{ .Level }}>
{{ else }}
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}</h{{ .Level }}>
{{ end }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 3b51bb0..93a0cb1 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -6,6 +6,10 @@
{{- .Scratch.Set "imageProc" (dict "highRes" (.Site.Params.imageProc.highRes | default .Site.Data.default.imageProc.highRes) "mediumRes" (.Site.Params.imageProc.mediumRes | default .Site.Data.default.imageProc.mediumRes) "lowRes" (.Site.Params.imageProc.lowRes | default .Site.Data.default.imageProc.lowRes) "markupAutoResizeWidth" (.Site.Params.imageProc.markupAutoResizeWidth | default .Site.Data.default.imageProc.markupAutoResizeWidth)) -}}
+<!-- Generate and set the SVG bundle -->
+{{- $svgBundle := resources.Get "svg/bundle.svg" | resources.ExecuteAsTemplate "img/bundle.svg" . | minify | resources.Fingerprint "md5" -}}
+{{- .Scratch.Set "svgBundle" $svgBundle -}}
+
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}" data-mode="{{ if .Site.Params.Style.isDark }}dark{{ else }}light{{ end }}">
<head prefix="og: http://ogp.me/ns#">
@@ -28,41 +32,6 @@
{{ partial "footer" . }}
</footer>
- <svg xmlns="http://www.w3.org/2000/svg" width="0" height="0" aria-hidden="true">
- <symbol viewBox="0 0 512 512" id="adjust">
- <path d="M8 256c0 136.966 111.033 248 248 248s248-111.034 248-248S392.966 8 256 8 8 119.033 8 256zm248 184V72c101.705 0 184 82.311 184 184 0 101.705-82.311 184-184 184z"/>
- </symbol>
-
- {{ if or (eq .Kind "section") (eq .Layout "search") }}
- <symbol viewBox="0 0 512 512" id="search">
- <path d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"/>
- </symbol>
- {{ end }}
-
- {{ block "svg-extra" . }}
- <!-- Additional symbols -->
- {{ end }}
-
- {{ if and (.HasShortcode "social") .Site.Params.Social }}
-
- <!-- Get info about social platform and icon id from "social.json" -->
- {{ range .Site.Data.social }}
- {{ if and (or (index $.Site.Params.Social.Centralized .entry) (index $.Site.Params.Social.Decentralized .entry)) .icon }}
- {{ $iconId := .icon.id }}
- {{ $svgEssential := `(?:<svg (?:.*?)(viewBox="(?:.*?)")(?:.*?)>((?:.|\n)+?)(?:</svg>))` }}
- {{ $asSymbol := printf `<symbol ${1} id="%s">${2}</symbol>` $iconId }}
-
- <!-- Get the required SVG file and insert here as a symbol -->
- {{ with (resources.Get (printf "svg/%s.svg" $iconId)) }}
- {{ .Content | replaceRE $svgEssential $asSymbol | safeHTML }}
- {{ end }}
- {{ end }}
- {{ end }}
-
- {{ end }}
-
- </svg>
-
<!-- Search -->
{{ if eq .Layout "search" }}
{{ $searchJS := resources.Get "js/search.js" | resources.ExecuteAsTemplate (printf "js/search.js" | relLangURL) . | minify | fingerprint }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 1305fd5..c8aac46 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -32,13 +32,3 @@
</main>
{{ end }}
-
-{{ define "svg-extra" }}
- <symbol viewBox="0 0 256 512" id="angle-right">
- <path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"/>
- </symbol>
-
- <symbol viewBox="0 0 448 512" id="angle-double-right">
- <path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"/>
- </symbol>
-{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 3a8a2d2..3bb3a85 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -42,7 +42,3 @@
</main>
{{ end }}
-
-{{ define "svg-extra" }}
- {{ partialCached "content-svg" . }}
-{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
index 15e535a..eaadede 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -33,9 +33,3 @@
</main>
{{ end }}
-
-{{ define "svg-extra" }}
- {{ if .Content }}
- {{ partialCached "content-svg" . }}
- {{ end }}
-{{ end }}
diff --git a/layouts/partials/content-svg.html b/layouts/partials/content-svg.html
deleted file mode 100644
index 73b0d3c..0000000
--- a/layouts/partials/content-svg.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- SVG symbols related to pages with content -->
-<symbol viewBox="0 0 448 512" id="hashtag">
- <path d="M440.667 182.109l7.143-40c1.313-7.355-4.342-14.109-11.813-14.109h-74.81l14.623-81.891C377.123 38.754 371.468 32 363.997 32h-40.632a12 12 0 0 0-11.813 9.891L296.175 128H197.54l14.623-81.891C213.477 38.754 207.822 32 200.35 32h-40.632a12 12 0 0 0-11.813 9.891L132.528 128H53.432a12 12 0 0 0-11.813 9.891l-7.143 40C33.163 185.246 38.818 192 46.289 192h74.81L98.242 320H19.146a12 12 0 0 0-11.813 9.891l-7.143 40C-1.123 377.246 4.532 384 12.003 384h74.81L72.19 465.891C70.877 473.246 76.532 480 84.003 480h40.632a12 12 0 0 0 11.813-9.891L151.826 384h98.634l-14.623 81.891C234.523 473.246 240.178 480 247.65 480h40.632a12 12 0 0 0 11.813-9.891L315.472 384h79.096a12 12 0 0 0 11.813-9.891l7.143-40c1.313-7.355-4.342-14.109-11.813-14.109h-74.81l22.857-128h79.096a12 12 0 0 0 11.813-9.891zM261.889 320h-98.634l22.857-128h98.634l-22.857 128z"/>
-</symbol>
-
-{{ if .Site.Params.Style.hasIconAsFootnoteReturnLink }}
- <symbol viewBox="0 0 320 512" id="caret-down">
- <path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/>
- </symbol>
-{{ end }} \ No newline at end of file
diff --git a/layouts/partials/footer-opt.html b/layouts/partials/footer-opt.html
index 9fb96ee..d31a4d9 100644
--- a/layouts/partials/footer-opt.html
+++ b/layouts/partials/footer-opt.html
@@ -1,11 +1,14 @@
+<!-- Get SVG bundle -->
+{{ $svgBundleLink := (.Page.Scratch.Get "svgBundle").RelPermalink }}
+
<!-- Get default accent colors -->
-{{ $lightAccent := .Site.Params.Style.lightAccent | default .Site.Data.default.style.lightAccent }}
-{{ $darkAccent := .Site.Params.Style.darkAccent | default .Site.Data.default.style.darkAccent }}
+{{ $defaultLightAccent := .Site.Params.Style.lightAccent | default .Site.Data.default.style.lightAccent }}
+{{ $defaultDarkAccent := .Site.Params.Style.darkAccent | default .Site.Data.default.style.darkAccent }}
-{{ $allAccentColors := union (slice $lightAccent $darkAccent) .Site.Params.Style.presets }}
+{{ $allAccentColors := union (slice $defaultLightAccent $defaultDarkAccent) .Site.Params.Style.presets }}
<section class="req-js">
- <button class="outline-dashed" title="{{ T "changeMode" }}"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use xlink:href="#adjust"/></svg></button><input class="outline-dashed" type="color" list="presets" value="{{ if .Site.Params.Style.isDark }}{{ $darkAccent }}{{ else }}{{ $lightAccent }}{{ end }}" title="{{ T "changeAccent" }}" aria-label="{{ T "changeAccent" }}"><datalist id="presets">{{ range $allAccentColors }}<option value="{{ . }}">{{ end }}</datalist>
+ <button class="outline-dashed" title="{{ T "changeMode" }}"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use xlink:href="{{ $svgBundleLink }}#adjust"/></svg></button><input class="outline-dashed" type="color" list="presets" value="{{ if .Site.Params.Style.isDark }}{{ $defaultDarkAccent }}{{ else }}{{ $defaultLightAccent }}{{ end }}" title="{{ T "changeAccent" }}" aria-label="{{ T "changeAccent" }}"><datalist id="presets">{{ range $allAccentColors }}<option value="{{ . }}">{{ end }}</datalist>
</section>
<!-- noscript notice -->
diff --git a/layouts/partials/head-style.html b/layouts/partials/head-style.html
index 4fae5ee..31f15b9 100644
--- a/layouts/partials/head-style.html
+++ b/layouts/partials/head-style.html
@@ -6,8 +6,8 @@
<!-- If JS is disabled -->
<noscript>
- {{ $lightAccent := .Site.Params.Style.lightAccent | default .Site.Data.default.style.lightAccent }}
{{ $darkAccent := .Site.Params.Style.darkAccent | default .Site.Data.default.style.darkAccent }}
+ {{ $lightAccent := .Site.Params.Style.lightAccent | default .Site.Data.default.style.lightAccent }}
{{ if .Site.Params.Style.ignoreSystemSettings }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 158a54b..78cee39 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -366,5 +366,11 @@
<!-- Main JS -->
-{{ $main := resources.Get "js/main.js" | resources.ExecuteAsTemplate "js/main.js" . | minify | fingerprint }}
-<script src="{{ $main.Permalink }}" integrity="{{ $main.Data.Integrity }}" crossorigin="anonymous"></script>
+{{ $mainJS := resources.Get "js/main.js" | resources.ExecuteAsTemplate "js/main.js" . | minify | fingerprint }}
+
+<!-- Use ESBuild if available -->
+{{ if ge hugo.Version "0.74" }}
+ {{ $mainJS = resources.Get "js/main.js" | resources.ExecuteAsTemplate "js/main.js" . | js.Build (dict "minify" "true") | fingerprint }}
+{{ end }}
+
+<script src="{{ $mainJS.Permalink }}" integrity="{{ $mainJS.Data.Integrity }}" crossorigin="anonymous"></script>
diff --git a/layouts/partials/katex-font-preload.html b/layouts/partials/katex-font-preload.html
index bbe53e7..988bab1 100644
--- a/layouts/partials/katex-font-preload.html
+++ b/layouts/partials/katex-font-preload.html
@@ -4,7 +4,7 @@
Adjust as necessary
-->
-{{ $katexVersion := "0.15.2" }}
+{{ $katexVersion := "0.15.3" }}
<link rel="preload" href="/libs/katex@{{ $katexVersion }}/dist/fonts/KaTeX_Main-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="/libs/katex@{{ $katexVersion }}/dist/fonts/KaTeX_Math-Italic.woff2" as="font" type="font/woff2" crossorigin="anonymous">
diff --git a/layouts/partials/katex.html b/layouts/partials/katex.html
index e336f80..c829c70 100644
--- a/layouts/partials/katex.html
+++ b/layouts/partials/katex.html
@@ -1,5 +1,5 @@
<!-- KaTeX -->
-{{ $katexVersion := "0.15.2" }}
+{{ $katexVersion := "0.15.3" }}
{{ $katexCSS := resources.Get (printf "libs/katex@%s/dist/katex.css" $katexVersion) | minify | fingerprint }}
<link rel="stylesheet" href="{{ $katexCSS.Permalink }}" integrity="{{ $katexCSS.Data.Integrity }}" crossorigin="anonymous">
@@ -44,4 +44,3 @@
{{ $katexCustomRender := slice $autoRender $katexAutoRenderOptions $katexPostRender | resources.Concat "js/katex-custom-render.js" | minify | fingerprint }}
<script defer src="{{ $katexCustomRender.Permalink }}" integrity="{{ $katexCustomRender.Data.Integrity }}" crossorigin="anonymous"></script>
-
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html
index 51500df..8445cc1 100644
--- a/layouts/partials/pagination.html
+++ b/layouts/partials/pagination.html
@@ -1,5 +1,8 @@
-{{ $pag := .Paginator }}
+<!-- Get SVG bundle -->
+{{ $svgBundleLink := (.Scratch.Get "svgBundle").RelPermalink }}
+
+{{ $pag := .Paginator }}
<!-- Number of links either side of the current page. Default value is 2 -->
{{ $adjacentLinks := 1 }}
@@ -24,7 +27,7 @@
<li>
<a class="btn" href="{{ $pag.First.URL }}" aria-label="{{ T "ariaGoToFirst" }}">
<svg aria-hidden="true">
- <use transform="rotate(180) translate(-18 -18)" xlink:href="#angle-double-right"/>
+ <use transform="rotate(180) translate(-18 -18)" xlink:href="{{ $svgBundleLink }}#angle-double-right"/>
</svg>
</a>
</li>
@@ -35,7 +38,7 @@
<li>
<a class="btn" href="{{ $pag.Prev.URL }}" aria-label="{{ T "ariaGoToPrev" }}">
<svg transform="rotate(180)" aria-hidden="true">
- <use xlink:href="#angle-right"/>
+ <use xlink:href="{{ $svgBundleLink }}#angle-right"/>
</svg>
</a>
</li>
@@ -104,7 +107,7 @@
<li>
<a class="btn" href="{{ $pag.Next.URL }}" aria-label="{{ T "ariaGoToNext" }}">
<svg aria-hidden="true">
- <use xlink:href="#angle-right"/>
+ <use xlink:href="{{ $svgBundleLink }}#angle-right"/>
</svg>
</a>
</li>
@@ -115,7 +118,7 @@
<li>
<a class="btn" href="{{ $pag.Last.URL }}" aria-label="{{ T "ariaGoToLast" }}">
<svg aria-hidden="true">
- <use xlink:href="#angle-double-right"/>
+ <use xlink:href="{{ $svgBundleLink }}#angle-double-right"/>
</svg>
</a>
</li>
diff --git a/layouts/partials/processed-content.html b/layouts/partials/processed-content.html
index 21ce5b0..8acb7ff 100644
--- a/layouts/partials/processed-content.html
+++ b/layouts/partials/processed-content.html
@@ -32,6 +32,9 @@
with line numbers (.lntd > .chroma).
-->
+<!-- Get SVG bundle -->
+{{ $svgBundleLink := (.Scratch.Get "svgBundle").RelPermalink }}
+
<!-- i18n -->
{{ $references := `(<section class="footnotes" role="doc-endnotes">)` }}
{{ $seeFootnotes := `(class="footnote-ref")` }}
@@ -70,7 +73,7 @@
<!-- OR replace the footnote return links with a SVG icon -->
{{ if .Site.Params.Style.hasIconAsFootnoteReturnLink }}
- {{ $improvedFootnoteReturnLink = printf `${1}<svg transform="rotate(180) translate(0 -1)" aria-hidden="true"><use xlink:href="#caret-down"/></svg>${2}` }}
+ {{ $improvedFootnoteReturnLink = printf `${1}<svg transform="rotate(180) translate(0 -1)" aria-hidden="true"><use xlink:href="%s#caret-down"/></svg>${2}` $svgBundleLink }}
{{ end }}
<!--
diff --git a/layouts/partials/search-form.html b/layouts/partials/search-form.html
index 142af3b..855b7bf 100644
--- a/layouts/partials/search-form.html
+++ b/layouts/partials/search-form.html
@@ -1,3 +1,6 @@
+<!-- Get SVG bundle -->
+{{ $svgBundleLink := (.Scratch.Get "svgBundle").RelPermalink }}
+
<!--
Assume that the first page in a collection with pages
using the "search" layout is the main search page
@@ -7,13 +10,14 @@
{{ $minLength := .Site.Params.Search.minLength | default .Site.Data.default.search.minLength }}
{{ $maxLength := .Site.Params.Search.maxLength | default .Site.Data.default.search.maxLength }}
+
<section class="req-js search-box">
{{ if eq .Layout "search" }}
<form role="search">
{{ else }}
<form role="search" action="{{ $searchPage.RelPermalink }}">
{{ end }}
- <label class="label-form" for="search-input">{{ T "searchLabel" }}</label><input class="input-text" type="search" id="search-input" title='{{ T "searchInput" (dict "minLength" $minLength "maxLength" $maxLength) }}' name="q" {{ with .Site.Params.Search.placeholder }}placeholder="{{ . }}"{{ end }} minlength="{{ $minLength }}" maxlength="{{ $maxLength }}" pattern="^[\S].*" required><button aria-label="{{ T "searchAriaButton" }}" class="btn outline-dashed" type="submit"><svg aria-hidden="true"><use xlink:href="#search"/></svg></button>
+ <label class="label-form" for="search-input">{{ T "searchLabel" }}</label><input class="input-text" type="search" id="search-input" title='{{ T "searchInput" (dict "minLength" $minLength "maxLength" $maxLength) }}' name="q" {{ with .Site.Params.Search.placeholder }}placeholder="{{ . }}"{{ end }} minlength="{{ $minLength }}" maxlength="{{ $maxLength }}" pattern="^[\S].*" required><button aria-label="{{ T "searchAriaButton" }}" class="btn outline-dashed" type="submit"><svg aria-hidden="true"><use xlink:href="{{ $svgBundleLink }}#search"/></svg></button>
</form>
<hr>
</section>
diff --git a/layouts/shortcodes/gifoid.html b/layouts/shortcodes/gifoid.html
index 48f3fac..7ff67a0 100644
--- a/layouts/shortcodes/gifoid.html
+++ b/layouts/shortcodes/gifoid.html
@@ -34,8 +34,13 @@
{{ $videoPath := .Page.Params.videoPath | default "video" }}
{{ $filePath := path.Join $videoPath $fileName }}
+{{ $videoFormats := slice "mp4" "webm" }}
+
<video class="gifoid {{ $class }}" autoplay loop muted playsinline {{ with $title }}title="{{ . }}"{{ end }}>
- <source src="{{ $filePath }}.mp4" type="video/mp4">
- <source src="{{ $filePath }}.webm" type="video/webm">
+
+ {{ range $videoFormats }}
+ <source src="{{ ($.Page.Resources.GetMatch (printf "%s.%s" $filePath .)).RelPermalink }}" type="{{ printf "video/%s" .}}">
+ {{ end }}
+
<p class="error">{{ T "missingCodec" }}</p>
</video>
diff --git a/layouts/shortcodes/social.html b/layouts/shortcodes/social.html
index b86c066..1fbca63 100644
--- a/layouts/shortcodes/social.html
+++ b/layouts/shortcodes/social.html
@@ -1,8 +1,13 @@
{{ if .Site.Params.Social }}
+
+ <!-- Get SVG bundle -->
+ {{ $svgBundleLink := (.Page.Scratch.Get "svgBundle").RelPermalink }}
+
<!-- Reduce repetition... -->
{{ $centralized := $.Site.Params.Social.Centralized }}
{{ $decentralized := $.Site.Params.Social.Decentralized }}
-
+
+
<section class="social">
{{ range .Site.Data.social }}
@@ -25,7 +30,7 @@
<a class="btn" href="{{ $url }}" rel="me nofollow" title="{{ $label }}">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
- <use xlink:href="#{{ $currentIcon }}"/>
+ <use xlink:href="{{ $svgBundleLink }}#{{ $currentIcon }}"/>
</svg>
<p>{{ $label }}</p>
@@ -40,7 +45,7 @@
{{ range (index $decentralized $currentEntry) }}
<a class="btn" href="{{ index . 0 }}" rel="me nofollow" title="{{ printf "%s (%s)" (index . 1) $currentLabel }}">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
- <use xlink:href="#{{ $currentIcon }}"/>
+ <use xlink:href="{{ $svgBundleLink }}#{{ $currentIcon }}"/>
</svg>
<p>{{ index . 1 | truncate 15 }}</p>