mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-15 09:52:10 +00:00
17 lines
630 B
XML
17 lines
630 B
XML
{{- $codeIndex := (.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>
|
|
{{- .Page.Scratch.Set "codeIndexRss" (add 1 $codeIndex) -}}
|