footnotes: render at end of page for all shortcodes #547

This commit is contained in:
Sören Weber 2023-05-31 23:44:27 +02:00
parent bbdaafd0d7
commit 61a3995389
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
14 changed files with 20 additions and 15 deletions

View file

@ -4,7 +4,9 @@ You can add standard markdown syntax:
- bullet point lists
- _emphasized_, **bold** and even **_bold emphasized_** text
- [links](https://example.com)
- etc.
- etc.[^etc]
[^etc]: Et Cetera (English: /ɛtˈsɛtərə/), abbreviated to etc., etc, et cet., is a Latin expression that is used in English to mean "and other similar things", or "and so forth"
```plaintext
...and even source code

View file

@ -7,6 +7,7 @@ title = "Children"
The `children` shortcode lists the child pages of the current page and its descendants.
{{% children sort="weight" %}}
## Usage
While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.

View file

@ -5,7 +5,19 @@ title = "Expand"
The `expand` shortcode displays an expandable/collapsible section of text.
{{% expand title="Expand me..." %}}Thank you!{{% /expand %}}
{{% expand title="Expand me..." %}}Thank you!
That's some text with a footnote[^1]
[^1]: And that's the footnote.
That's some more text with a footnote.[^someid]
[^someid]:
Anything of interest goes here.
Blue light glows blue.
{{% /expand %}}
{{% notice note %}}
This only works in modern browsers flawlessly. While Internet Explorer 11 has issues in displaying it, the functionality still works.

View file

@ -16,5 +16,5 @@
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
{{- end }}
{{- with $context -}}
<span class="badge cstyle {{ $style }}{{ if or $icon $title }} badge-with-title{{ end }}">{{ if or $icon $title }}<span class="badge-title">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ if $title }}{{ $title | markdownify }}{{ end }}</span>{{ end }}<span class="badge-content"{{ if $color }} style="background-color: {{ $color }};"{{ end }}>{{ $content }}</span></span>
<span class="badge cstyle {{ $style }}{{ if or $icon $title }} badge-with-title{{ end }}">{{ if or $icon $title }}<span class="badge-title">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ if $title }}{{ $title | markdownify }}{{ end }}</span>{{ end }}<span class="badge-content"{{ if $color }} style="background-color: {{ $color }};"{{ end }}>{{ $content | markdownify }}</span></span>
{{- end }}

View file

@ -44,8 +44,8 @@
{{- end }}
{{- if and $icon (eq $iconposition "left") }}
<i class="{{ $icon }}"></i>
{{- end }}
{{ $title | safeHTML }}
{{- end }}
{{ $title | markdownify }}
{{- if and $icon (eq $iconposition "right") }}
<i class="{{ $icon }}"></i>
{{- end }}

View file

@ -1,4 +1,3 @@
{{- $_hugo_config := `{ "version": 1 }` }}
{{- partial "shortcodes/attachments.html" (dict
"context" .Page
"color" (.Get "color")

View file

@ -1,4 +1,3 @@
{{- $_hugo_config := `{ "version": 1 }` }}
{{- partial "shortcodes/badge.html" (dict
"context" .Page
"color" (.Get "color")

View file

@ -1,4 +1,3 @@
{{- $_hugo_config := `{ "version": 1 }` }}
{{- partial "shortcodes/button.html" (dict
"context" .Page
"color" (.Get "color")

View file

@ -1,4 +1,3 @@
{{- $_hugo_config := `{ "version": 1 }` }}
{{- partial "shortcodes/children.html" (dict
"context" .Page
"containerstyle" (.Get "containerstyle")

View file

@ -1,4 +1,3 @@
{{- $_hugo_config := `{ "version": 1 }` }}
{{- $version := split hugo.Version "." }}
{{- $major := int (index $version 0) }}
{{- $minor := int (index $version 1) }}

View file

@ -1,4 +1,3 @@
{{- $_hugo_config := `{ "version": 1 }` }}
{{- partial "shortcodes/icon.html" (dict
"context" .Page
"icon" (.Get "icon" | default (.Get 0))

View file

@ -1,4 +1,3 @@
{{- $_hugo_config := `{ "version": 1 }` }}
{{- partial "shortcodes/math.html" (dict
"context" .Page
"content" .Inner

View file

@ -1,4 +1,3 @@
{{- $_hugo_config := `{ "version": 1 }` }}
{{- partial "shortcodes/mermaid.html" (dict
"context" .Page
"content" .Inner

View file

@ -1,5 +1,3 @@
<!-- {{- .Inner }} -->
{{- $_hugo_config := `{ "version": 1 }` }}
{{- partial "shortcodes/notice.html" (dict
"context" .Page
"color" (.Get "color")