mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 04:13:17 -06:00
Use partialCached on icon partial
This commit is contained in:
parent
fa5c014a1b
commit
cba6dd0a2f
@ -1,6 +1 @@
|
||||
{{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}}
|
||||
{{- $icon := $icon_resource.Content -}}
|
||||
{{- $icon = replaceRE `<svg` `<svg class="icon"` $icon -}}
|
||||
{{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}}
|
||||
{{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}}
|
||||
{{- $icon | safeHTML -}}
|
||||
{{ partialCached "icon_code.html" . . }}
|
||||
|
6
layouts/partials/icon_code.html
Normal file
6
layouts/partials/icon_code.html
Normal file
@ -0,0 +1,6 @@
|
||||
{{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}}
|
||||
{{- $icon := $icon_resource.Content -}}
|
||||
{{- $icon = replaceRE `<svg` `<svg class="icon"` $icon -}}
|
||||
{{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}}
|
||||
{{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}}
|
||||
{{- $icon | safeHTML -}}
|
Loading…
Reference in New Issue
Block a user