1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 12:35:31 -04:00

get logo from an actual .svg file and inline it

This commit is contained in:
2020-04-23 17:13:41 -04:00
parent 2548b320fc
commit d38ff15c2f
9 changed files with 25 additions and 57 deletions

View File

@@ -1,15 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 144" width="30" height="45">
<g id="c1" fill="#6fbc4e">
<polygon points="57.6 0 38.4 11.1 38.4 11.1 76.8 33.2 96 22.1 96 22.1 57.6 0 57.6 0"/>
<polygon points="19.2 66.5 0 77.6 0 77.6 19.2 88.7 38.4 77.6 38.4 77.6 19.2 66.5 19.2 66.5"/>
<polygon points="57.6 88.7 19.2 110.9 19.2 110.9 38.4 121.9 76.8 99.8 76.8 99.8 57.6 88.7 57.6 88.7"/>
</g>
<g id="c2" fill="#ffb900">
<polygon points="38.4 11.1 38.4 33.3 57.6 44.3 57.6 88.7 76.8 99.8 76.8 33.2 38.4 11.1 38.4 11.1"/>
<polygon points="19.2 110.9 19.2 110.8 19.2 88.7 0 77.6 0 121.9 38.4 144.1 38.4 121.9 19.2 110.9 19.2 110.9"/>
</g>
<g id="c3" fill="#009cdf">
<polygon points="76.8 33.2 76.8 99.8 76.8 99.8 38.4 121.9 38.4 144.1 96 110.9 96 22.1 76.8 33.2 76.8 33.2"/>
<polygon points="19.2 110.9 38.4 99.8 38.4 77.6 19.2 88.7 19.2 110.9 19.2 110.9"/>
</g>
</svg>
{{ $logo := resources.Get "img/logo.svg" -}}
{{ $svg := $logo.Content -}}
{{ $svg = replaceRE "<\\?xml.+\\?>" "" $svg -}}
{{ $svg = replace $svg "<svg" "<svg width=\"30\" height=\"45\"" -}}
{{ printf "<!-- inlined: %s -->" $logo.Permalink | safeHTML }}
{{ $svg | safeHTML -}}

Before

Width:  |  Height:  |  Size: 915 B

After

Width:  |  Height:  |  Size: 277 B