1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 14:21:16 -04:00

fingerprint CSS and JS, set one week browser cache

...and LOTS of tidying partials
This commit is contained in:
2020-04-25 11:15:31 -04:00
parent d2648a68be
commit adfa73b5fc
25 changed files with 86 additions and 110 deletions

View File

@@ -0,0 +1,14 @@
{{ $svg := resources.Get "img/logo.svg" -}}
{{ $html := $svg.Content -}}
{{/* remove unneeded tags/attributes when SVG is inlined versus a .svg file */}}
{{ $html = replaceRE "<\\?xml.+\\?>" "" $html -}}
{{ $html = replaceRE " version=\"(.*?)\"" "" $html -}}
{{ $html = replaceRE " xmlns=\"(.*?)\"" "" $html -}}
{{ $wxh := printf "<svg width=\"%d\" height=\"%d\"" .width .height }}
{{ $html = replace $html "<svg" $wxh -}}
{{ printf "<!-- auto-inlined from: %s -->" $svg.Permalink | safeHTML }}
{{ $html | safeHTML -}}