feat(codeblock): add title support

This commit is contained in:
ZhenShuo Leo
2025-12-15 21:17:35 +08:00
parent f487e616bf
commit 0e3bad2be7
5 changed files with 73 additions and 36 deletions

View File

@@ -0,0 +1,10 @@
{{- $title := or .Attributes.title "" -}}
{{- $lang := or .Type "text" -}}
<div class="highlight-wrapper">
{{- with $title -}}
<div class="codeblock-title">
{{- $title -}}
</div>
{{- end -}}
{{- transform.Highlight .Inner $lang .Options -}}
</div>