Fix Heroicons integration

This commit is contained in:
Gabriel Arazas 2022-10-24 00:08:28 +08:00
parent 43e5ff1540
commit d0c6a48334
4 changed files with 8 additions and 3 deletions

View File

@ -20,6 +20,11 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version
== Unreleased
=== Fixed
- Heroicons integration. footnote:[This is what I get for doing things at night. Before sleep.]
== [0.3.0] - 2022-10-23

View File

@ -2,7 +2,7 @@
This template applies an ID to an SVG from the Heroicons set to be used with `<use>` element.
*/ -}}
{{- $match := "<svg (.*)?>\\s*(.*)\\s*</svg>" }}
{{- $icon := resources.Get (printf "svg/heroicons/solid/%s.svg" .) }}
{{- $icon := resources.Get (printf "svg/heroicons/24/solid/%s.svg" .) }}
{{- $replaceWith := printf `<svg id="%s" ${1}>${2}</svg>` . }}
{{- replaceRE $match $replaceWith $icon.Content | safeHTML }}

View File

@ -12,7 +12,7 @@
{{- if and .GitInfo (ne (.PublishDate.Format "2006-01-02") (.Lastmod.Format "2006-01-02")) }}
<time datetime="{{ .Lastmod }}" title="{{ i18n "updated_on" }}">
{{ partial "components/heroicon.html" "refresh" }}
{{ partial "components/heroicon.html" "arrow-path" }}
<span style="margin-left: 0.5em;">{{ .Lastmod.Format "2006-01-02" }}</span>
</time>
{{- end }}

View File

@ -4,7 +4,7 @@
*/ -}}
{{- if gt (len (index $.Site.Data "more-contentful").themes) 1 }}
<div class="site__theme-btn" aria-label="Theme toggle">
{{ partial "components/heroicon.html" "color-swatch" }}
{{ partial "components/heroicon.html" "swatch" }}
<div class="site__theme-dropdown">
<div class="site__theme-dropdown-list">
{{ $themes := (index $.Site.Data "more-contentful").themes }}