Always add line numbers (why not?), but specially tag Agda blocks

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-05-21 20:41:10 -07:00
parent 52ea5abbc8
commit a6425c7510

View File

@ -1,9 +1,7 @@
{{- if eq .language "Agda" -}}
{{- page.Scratch.Set "highlightGroupAttrs" (printf "data-agda-block") -}}
{{- if (or .firstLine .lastLine) -}}
{{- page.Scratch.Add "highlightGroupAttrs" (printf " data-agda-first-line=\"%v\" data-agda-last-line=\"%v\"" .firstLine .lastLine) -}}
{{- page.Scratch.Set "highlightGroupAttrs" (printf "data-first-line=\"%v\" data-last-line=\"%v\"" .firstLine .lastLine) -}}
{{- end -}}
{{- else -}}
{{- page.Scratch.Set "highlightGroupAttrs" nil -}}
{{- if eq .language "Agda" -}}
{{- page.Scratch.Add "highlightGroupAttrs" " data-agda-block" -}}
{{- end -}}
{{ partial "group.html" (dict "url" .url "path" .path "comment" .comment "content" (highlight .code .language .opts) "attrs" (page.Scratch.Get "highlightGroupAttrs")) }}