feat(layout): add the language and a button to copy code blocks

This commit is contained in:
Bruno Carlin 2025-07-06 14:22:12 +02:00
parent 7c3facdd0f
commit 7b84496201
Signed by: bcarlin
GPG key ID: 8E254EA0FFEB9B6D
3 changed files with 124 additions and 12 deletions

View file

@ -0,0 +1,13 @@
{{- $result := transform.HighlightCodeBlock . }}
<div class="highlight">
<div>
{{- .Type -}}
<span data-action="copy">copy</span>
</div>
<pre tabindex="0" class="chroma">
{{- /* chomp newline */ -}}
<code class="language-{{ .Type }}" data-lang="{{ .Type }}">{{ $result.Inner }}</code>
{{- /* chomp newline */ -}}
</pre>
</div>
{{- /* chomp trailing newline */ -}}