Skip to content

Commit

Permalink
fix: remove page method that lead to erroneous icons in pagination
Browse files Browse the repository at this point in the history
closes davidsneighbour/kollitsch.dev#905

Signed-off-by: Patrick Kollitsch <[email protected]>
  • Loading branch information
davidsneighbour committed May 10, 2024
1 parent a5ea195 commit 542935c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/icons/layouts/partials/icons/use.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{- $iconname := .icon | default "dash-square-dotted" -}}
<svg{{ with .width }} width="{{- . -}}"{{ end }}{{ with .height }} height="{{- . -}}"{{ end }}
version="2.0" class="icon icon-{{- $iconname }} {{ .class -}}">
{{- $icons := page.Scratch.Get "icons" -}}
{{- $icons := .Scratch.Get "icons" -}}
{{- if eq (index $icons $iconname) true -}}
{{- else -}}
{{- $iconpath := printf $config.path $iconname -}}
Expand All @@ -16,7 +16,7 @@
{{- $replacement := printf "<symbol %s " $replaceId -}}
{{- $content = replace $content "<svg " $replacement 1 -}}
{{- $content = replace $content "</svg>" "</symbol>" 1 -}}
{{- page.Scratch.SetInMap "icons" $iconname true -}}
{{- .Scratch.SetInMap "icons" $iconname true -}}
{{- $content | safeHTML -}}
{{- end -}}
<use href="#{{- $iconname -}}"{{ with .width }} width="{{- . -}}"{{ end }}{{ with .height }} height="{{- . -}}"{{ end }} />
Expand Down

0 comments on commit 542935c

Please sign in to comment.