vanilla-hugo/layouts/partials/highlightgroup.html
Danila Fedorin e531ebd992 Also include the base path and the file path in highlight groups
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-05-21 21:44:59 -07:00

8 lines
512 B
HTML

{{- if (or .firstLine .lastLine) -}}
{{- page.Scratch.Set "highlightGroupAttrs" (printf "data-first-line=\"%v\" data-last-line=\"%v\" data-base-path=\"%s\" data-file-path=\"%v\"" .firstLine .lastLine .basePath .path) -}}
{{- end -}}
{{- 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")) }}