2024-06-09 18:36:54 -07:00
|
|
|
{{- $scratch := newScratch -}}
|
|
|
|
{{- $scratch.Set "highlightGroupAttrs" (printf "data-base-path=\"%s\" data-file-path=\"%v\"" .basePath .path) -}}
|
2024-05-21 20:39:28 -07:00
|
|
|
{{- if (or .firstLine .lastLine) -}}
|
2024-06-09 18:36:54 -07:00
|
|
|
{{- $scratch.Add "highlightGroupAttrs" (printf " data-first-line=\"%v\" data-last-line=\"%v\"" .firstLine .lastLine) -}}
|
2024-05-21 20:39:28 -07:00
|
|
|
{{- end -}}
|
2024-05-23 00:56:51 -07:00
|
|
|
{{- if eq (lower .language) "agda" -}}
|
2024-06-09 18:36:54 -07:00
|
|
|
{{- $scratch.Add "highlightGroupAttrs" " data-agda-block" -}}
|
2024-05-21 20:39:28 -07:00
|
|
|
{{- end -}}
|
2024-06-09 18:36:54 -07:00
|
|
|
{{ partial "group.html" (dict "url" .url "path" .path "comment" .comment "content" (highlight .code .language .opts) "attrs" ($scratch.Get "highlightGroupAttrs")) }}
|