mirror of
https://github.com/foo-dogsquared/hugo-theme-more-contentful.git
synced 2025-01-30 22:57:57 +00:00
Fix Heroicons integration
This commit is contained in:
parent
43e5ff1540
commit
d0c6a48334
@ -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
|
||||
|
@ -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 }}
|
||||
|
@ -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 }}
|
||||
|
@ -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 }}
|
||||
|
Loading…
Reference in New Issue
Block a user