1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-28 08:35:47 -04:00

clean up a bunch of layouts, especially social-images function

also made even more config.toml parameters optional, will help when finally releasing theme
This commit is contained in:
2020-06-25 10:35:59 -04:00
parent 0a48ce296f
commit f3198e0235
31 changed files with 167 additions and 162 deletions

View File

@@ -1,15 +1,15 @@
{{ $svg := resources.Get .src -}}
{{ $html := $svg.Content -}}
{{- $svg := resources.Get .src -}}
{{- $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 -}}
{{- $html = replaceRE "<\\?xml.+\\?>" "" $html -}}
{{- $html = replaceRE " version=\"(.*?)\"" "" $html -}}
{{- $html = replaceRE " xmlns=\"(.*?)\"" "" $html -}}
{{ $wxh := printf "<svg width=\"%d\" height=\"%d\"" .width .height }}
{{- $wxh := printf "<svg width=\"%d\" height=\"%d\" " .width .height }}
{{ $html = replace $html "<svg" $wxh -}}
{{- $html = replace $html "<svg " $wxh -}}
{{/* bit of a hack: calling .Permalink so that the SVG file is published too */}}
{{ printf "<!-- auto-inlined from: %s -->" $svg.Permalink | safeHTML }}
{{ $html | safeHTML -}}
{{/* bit of a hack: calling .Permalink so that the SVG file is published too, comment will be removed when minified */}}
{{- printf "<!-- auto-inlined from: %s -->" $svg.Permalink | safeHTML }}
{{- $html | safeHTML -}}