diff --git a/hugo.toml b/hugo.toml index 7163a306..e8329253 100644 --- a/hugo.toml +++ b/hugo.toml @@ -1168,7 +1168,7 @@ twemoji = false # set to true, images in the content will be shown as the gallery if the image has a title, e.g.  # set to "force", images in the content will be forced to shown as the gallery regardless of the image has a title or not, e.g.  # TODO change gallery engine in the future -lightgallery = true +lightgallery = false # whether to enable the ruby extended syntax ruby = true # whether to enable the fraction extended syntax diff --git a/layouts/_markup/render-codeblock.rss.xml b/layouts/_markup/render-codeblock.rss.xml new file mode 100644 index 00000000..79577aa2 --- /dev/null +++ b/layouts/_markup/render-codeblock.rss.xml @@ -0,0 +1,3 @@ +{{- $result := transform.HighlightCodeBlock . -}} +
{{ $result.Inner }}
+{{- /* EOF */ -}}
diff --git a/layouts/_partials/function/code-header.html b/layouts/_partials/function/code-header.html
index 850c1594..f0453a84 100644
--- a/layouts/_partials/function/code-header.html
+++ b/layouts/_partials/function/code-header.html
@@ -1,7 +1,7 @@
{{- /* Code header for classic mode code blocks */ -}}
{{- $config := .Config -}}
{{- $wrapper := .Wrapper -}}
-{{- $type := lower .Type | default "fallback" -}}
+{{- $lang := cond (transform.CanHighlight .Type) (lower .Type) "fallback" -}}
{{- $name := $config.name -}}
{{- $lineNosBtn := "" -}}
{{- $lineWrapBtn := "" -}}
@@ -33,7 +33,7 @@
{{- with $config.name -}}
{{- $titleEl = replace $titleEl `` (printf `` .) -}}
{{- end -}}
-{{- $codeHeader := printf `| ]*class="lntd"[^>]*>.*? | \s*]*class="lntd"[^>]*>(.*?) | \s*
]*>.*?` $content -}}
- {{- if gt (len $codeBlocks) 0 -}}
- {{- range $i, $block := $codeBlocks -}}
- {{- $newBlock := $block -}}
- {{- $textMatches := findRE `>([^<]+)<` $block -}}
- {{- if gt (len $textMatches) 0 -}}
- {{- range $j, $m := $textMatches -}}
- {{- $inner := $m | replaceRE `^>([^<]+)<$` "$1" -}}
- {{- $newInner := replace $inner " " " " -}}
- {{- $newMatch := printf ">%s<" $newInner -}}
- {{- $newBlock = replace $newBlock $m $newMatch -}}
- {{- end -}}
- {{- end -}}
- {{- $content = replace $content $block $newBlock -}}
- {{- end -}}
- {{- end -}}
-
{{- /* Keep only the first ...inside a diagram-container */ -}} {{- $content = $content | replaceRE `(?s)
]*class="mermaid"[^>]*>.*?).*?
]*class="mermaid"[^>]*>.*?` $content -}} diff --git a/layouts/_partials/init/index.html b/layouts/_partials/init/index.html index 665082d0..02ed4bc0 100644 --- a/layouts/_partials/init/index.html +++ b/layouts/_partials/init/index.html @@ -1,4 +1,4 @@ -{{- hugo.Store.Set "version" "v0.4.0-alpha.3-20251219061028-5dcb107d" -}} +{{- hugo.Store.Set "version" "v0.4.0-alpha.3-20251219073856-c35dce56" -}} {{- .Store.Set "this" dict -}} {{- partial "init/detection-env.html" . -}}