asw-v01: archive deferred content (packs, site, lab, legacy examples)
- 2.1: packs/ -> archive/packs/ - 2.2: site/ -> archive/site/ - 2.3: src/lab/ -> archive/lab/ - 2.4: examples/ -> archive/examples-legacy/ (SSI-based)
This commit is contained in:
parent
416fe2f180
commit
e47a9f4401
173 changed files with 11 additions and 5 deletions
20
archive/packs/hugo/layouts/shortcodes/wikilink.html
Normal file
20
archive/packs/hugo/layouts/shortcodes/wikilink.html
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{{- /*
|
||||
wikilink shortcode — renders an internal link with ASW data-wikilink attribute.
|
||||
|
||||
Usage:
|
||||
{{< wikilink "Display Text" "/path/to/page/" >}}
|
||||
|
||||
Param 0 (required): display text
|
||||
Param 1 (optional): href path. Defaults to /display-text-slugified/
|
||||
|
||||
Examples:
|
||||
{{< wikilink "My Note" >}}
|
||||
→ <a href="/my-note/" data-wikilink>My Note</a>
|
||||
|
||||
{{< wikilink "My Note" "/vault/my-note/" >}}
|
||||
→ <a href="/vault/my-note/" data-wikilink>My Note</a>
|
||||
*/ -}}
|
||||
{{- $text := .Get 0 -}}
|
||||
{{- $slug := $text | lower | replace " " "-" -}}
|
||||
{{- $href := .Get 1 | default (printf "/%s/" $slug) -}}
|
||||
<a href="{{ $href | relURL }}" data-wikilink>{{ $text }}</a>
|
||||
Loading…
Add table
Add a link
Reference in a new issue