mirror of
https://github.com/PrivSec-dev/privsec.dev
synced 2025-02-20 18:31:35 -05:00
Add abbr
shortcode
This commit is contained in:
parent
d86718af36
commit
5b51384e61
48
layouts/shortcodes/abbr.html
Normal file
48
layouts/shortcodes/abbr.html
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{{/*
|
||||||
|
|
||||||
|
HTML abbreviation element
|
||||||
|
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr
|
||||||
|
|
||||||
|
Output:
|
||||||
|
<abbr>Abbreviation</abbr>
|
||||||
|
<abbr title="Expansion">Abbreviation</abbr>
|
||||||
|
|
||||||
|
Syntax:
|
||||||
|
{{< abbr "Abbreviation" />}}
|
||||||
|
{{< abbr abbr="Abbreviation" />}}
|
||||||
|
{{< abbr >}}Abbreviation{{< /abbr >}}
|
||||||
|
|
||||||
|
{{< abbr "Abbreviation" "Expansion" />}}
|
||||||
|
{{< abbr abbr="Abbreviation" title="Expansion" />}}
|
||||||
|
{{< abbr "Expansion" >}}Abbreviation{{< /abbr >}}
|
||||||
|
{{< abbr title="Expansion" >}}Abbreviation{{< /abbr >}}
|
||||||
|
|
||||||
|
This file and its contents are licensed under the Blue Oak Model License 1.0.0.
|
||||||
|
https://blueoakcouncil.org/license/1.0.0
|
||||||
|
(c) 2022 WfKe9vLwSvv7rN
|
||||||
|
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- $abbr := "" -}}
|
||||||
|
{{- $title := "" -}}
|
||||||
|
|
||||||
|
{{- with .Get "title" -}}
|
||||||
|
{{- $title = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- with .Inner -}}
|
||||||
|
{{- $abbr = $.Page.RenderString . -}}
|
||||||
|
{{- with $.Get 0 -}}
|
||||||
|
{{- $title = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- if .IsNamedParams -}}
|
||||||
|
{{- $abbr = .Get "abbr" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $abbr = .Get 0 -}}
|
||||||
|
{{- with .Get 1 -}}
|
||||||
|
{{- $title = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
<abbr {{- with $title }} title="{{ . }}"{{ end }}>{{ $abbr }}</abbr>
|
Loading…
Reference in New Issue
Block a user