From 286b14e540b35dcb5ca30c507dd36c106d79d1a9 Mon Sep 17 00:00:00 2001 From: tdro Date: Sat, 7 Oct 2023 20:19:06 -0400 Subject: themes/default/layouts/_default/_markup/render-codeblock: Support content editable --- .../default/layouts/_default/_markup/render-codeblock.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'themes/default/layouts/_default') diff --git a/themes/default/layouts/_default/_markup/render-codeblock.html b/themes/default/layouts/_default/_markup/render-codeblock.html index 1321d8e..542c9a6 100644 --- a/themes/default/layouts/_default/_markup/render-codeblock.html +++ b/themes/default/layouts/_default/_markup/render-codeblock.html @@ -3,6 +3,11 @@ {{- $options := .Attributes.options | default "default=1" -}} {{- $hash := print (truncate 3 "" (sha256 .Inner)) (truncate 3 "" (sha256 .Page.RelPermalink)) .Ordinal -}} {{- $id := print "code-block:" $hash | safeURL -}} +{{- $edit := "false" -}} + +{{- if not (in $options "linenos=1") -}} + {{- $edit = "true" -}} +{{- end -}}
@@ -10,9 +15,11 @@ {{ $type }}
- {{ highlight .Inner $type (print $options ",lineAnchors=" "code-line:" $hash) }} + + {{- highlight .Inner $type (print $options ",lineAnchors=" "code-line:" $hash) -}} +
-{{ with $caption }} +{{- with $caption -}} -{{ end }} +{{- end -}} -- cgit v1.2.3