mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 12:52:10 +00:00
bf8aadf8bb
- Stop using symlinks for template files, since those seem to have broken. - Force int data type for scratchpad integers since type inference seems to have changed.
17 lines
619 B
XML
17 lines
619 B
XML
{{- .Page.Scratch.Add "codeIndexRss" 1 -}}
|
|
{{- $codeIndex := (int (.Page.Scratch.Get "codeIndexRss")) -}}
|
|
{{- $id := (printf `code-%d` $codeIndex) -}}
|
|
{{- with .Get "id" -}}
|
|
{{- $id = . -}}
|
|
{{- end -}}
|
|
{{ with .Parent }}
|
|
{{- with .Get "id" -}}
|
|
{{- $id = . -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
<figcaption id="{{ $id }}-caption">
|
|
<span id="{{ $id }}" tabindex="-1">
|
|
<strong itemprop="name"> <span itemprop="codeSampleType">Code snippet</span> {{ $codeIndex }}</strong>{{with .Get "lang"}} (<span itemprop="programmingLanguage">{{ . }}</span>){{ end -}}
|
|
</span>:
|
|
{{ .Inner | .Page.RenderString | safeHTML }}
|
|
</figcaption>
|