From cba6dd0a2f0e391841a9c5195e4c5b0da35c8e9a Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Mon, 2 May 2022 21:11:38 -0500 Subject: [PATCH] Use partialCached on icon partial --- layouts/partials/icon.html | 7 +------ layouts/partials/icon_code.html | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 layouts/partials/icon_code.html diff --git a/layouts/partials/icon.html b/layouts/partials/icon.html index f5003c2..f2f972a 100644 --- a/layouts/partials/icon.html +++ b/layouts/partials/icon.html @@ -1,6 +1 @@ -{{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}} -{{- $icon := $icon_resource.Content -}} -{{- $icon = replaceRE `` (printf `%s icon` .) $icon -}} -{{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}} -{{- $icon | safeHTML -}} +{{ partialCached "icon_code.html" . . }} diff --git a/layouts/partials/icon_code.html b/layouts/partials/icon_code.html new file mode 100644 index 0000000..f5003c2 --- /dev/null +++ b/layouts/partials/icon_code.html @@ -0,0 +1,6 @@ +{{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}} +{{- $icon := $icon_resource.Content -}} +{{- $icon = replaceRE `` (printf `%s icon` .) $icon -}} +{{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}} +{{- $icon | safeHTML -}}