File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ <#
2+ . SYNOPSIS
3+ Includes Feather Icons
4+ . DESCRIPTION
5+ Includes a feather icon in the site.
6+ . NOTES
7+ Icons will be cached in memory to avoid repeated CDN requests.
8+ . EXAMPLE
9+ . $site.Includes.Feather "clipboard"
10+ . LINK
11+ https://feathericons.com/
12+ #>
13+ param (
14+ [string ]
15+ $Icon = ' chevron-right' ,
16+
17+ [uri ]
18+ $FeatherCDN = " https://cdn.jsdelivr.net/gh/feathericons/feather@latest/icons/"
19+ )
20+
21+ if (-not $script :FeatherIconCache ) {
22+ $script :FeatherIconCache = [Ordered ]@ {}
23+ }
24+ $icon = $icon.ToLower () -replace ' \.svg$'
25+
26+ if (-not $script :FeatherIconCache [$icon ]) {
27+ $script :FeatherIconCache [$icon ] = Invoke-RestMethod " $FeatherCDN /$Icon .svg"
28+ }
29+
30+ $script :FeatherIconCache [$icon ].OuterXml
31+
32+
You can’t perform that action at this time.
0 commit comments