Skip to content

Commit 98d6bba

Browse files
committed
feat: Support the pre-built icon shortcodes
1 parent 4c1b409 commit 98d6bba

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

exampleSite/content/test-product/lucide/permitted.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ weight: 100
1515
Here are some icons that are using font-awesome but should be backwards compatible:
1616
<i class="fa-solid fa-check" style="color:green"></i>
1717
<i class="fa fa-circle"></i>
18+
<i class="fa-solid fa-bug" style="color:#E4002B"></i>
19+
<i class="fa-solid fa-bug-slash" style="color:#666666"></i>
20+
<i class="fa-solid fa-circle-info" style="color:#1d9cd3;"></i>
21+
<i class="fa-solid fa-file-circle-plus" style="color:#009639"></i>
1822
{{<warning>}}
1923
This is a Warning callout. There was previously a bug with **bold text** that we should be aware of and continue to check for. This callout was invoked with the `<warning>` shortcode. It has no custom title. {{<fe "octagon-alert">}}
2024
{{</warning>}}

layouts/_default/docs.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
{{$iconName = index (index $submatches 0) 1}}
2020
{{$styleAttr = index (index $submatches 0) 2}}
2121

22+
{{ $iconMappings := dict "bug-slash" "bug-off" "circle-info" "info" "file-circle-plus" "file-plus"}}
23+
{{ with index $iconMappings $iconName }}
24+
{{$iconName = .}}
25+
{{ end }}
26+
2227
{{$iconHTML := partial "lucide" (dict
2328
"context" $
2429
"icon" $iconName

layouts/partials/lucide.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- /* Usage: */ -}}
22
{{- /* (dict "context" . "icon" "circle") */ -}}
3-
<svg class="lucide" style="{{ .style }}">
3+
<svg class="lucide" style="{{ .style | safeCSS }}">
44
<use href="/images/lucide-sprite.svg#{{ .icon }}"></use>
55
</svg>

0 commit comments

Comments
 (0)