.github
archetypes
assets
exampleSite
i18n
images
layouts
_default
partials
shortcodes
paige
code.html
figure.html
gallery.html
icon.html
image.html
quote.html
vimeo.html
youtube.html
404.html
paige
static
.gitignore
LICENSE
README.md
config.toml
go.mod
theme.toml
24 lines
782 B
HTML
24 lines
782 B
HTML
{{ $class := .Get 0 | default (.Get "class") }}
|
|
{{ $name := .Get "name" }}
|
|
{{ $url := .Get "url" }}
|
|
|
|
{{ if not $class }}
|
|
{{ errorf "layouts/shortcodes/paige/icon.html: no class" }}
|
|
{{ end }}
|
|
|
|
<span class="paige-icon">
|
|
{{ with $url -}}
|
|
{{- if hasPrefix . "mailto:" -}}
|
|
<a href="#" data-a="{{ base64Encode (index (split . `@`) 0) }}" data-b="{{ base64Encode `@` }}" data-c="{{ base64Encode (index (split . `@`) 1) }}" onclick="this.href = atob(this.dataset.a) + atob(this.dataset.b) + atob(this.dataset.c)">
|
|
{{- else -}}
|
|
<a href="{{ . }}">
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
<i class="{{ $class }}">{{ with $name }}<span class="visually-hidden">{{ . }}</span>{{ end }}</i>
|
|
|
|
{{- if $url -}}
|
|
</a>
|
|
{{- end }}
|
|
</span>
|