mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 12:35:31 -04:00
create inline-svg partial function
[skip ci]
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{{ $svg := resources.Get "img/logo.svg" -}}
|
||||
{{ $svg := resources.Get .src -}}
|
||||
{{ $html := $svg.Content -}}
|
||||
|
||||
{{/* remove unneeded tags/attributes when SVG is inlined versus a .svg file */}}
|
||||
@@ -10,5 +10,6 @@
|
||||
|
||||
{{ $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 -}}
|
@@ -1,7 +1,7 @@
|
||||
<header>
|
||||
<nav>
|
||||
<a class="no-underline" href="{{ .Site.BaseURL }}" id="logo" rel="me author" aria-label="{{ .Site.Title }}">
|
||||
{{ partial "svg/logo.svg" (dict "width" 28 "height" 40) }}
|
||||
{{ partial "functions/inline-svg" (dict "src" "img/logo.svg" "width" 28 "height" 40) }}
|
||||
<h1 id="name">{{ .Site.Title }}</h1>
|
||||
</a>
|
||||
<ul>
|
||||
|
Reference in New Issue
Block a user