Skip to content

Commit e140b0e

Browse files
style: psturtle.com ( Fixes #134 )
Adding _includes/Feather
1 parent c3d789b commit e140b0e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

psturtle.com/_includes/Feather.ps1

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+

0 commit comments

Comments
 (0)