fix: hide line number column in code block for RSS feed (#652)

This commit is contained in:
Cell
2025-10-22 16:33:18 +08:00
committed by GitHub
parent dd877f8041
commit f984fc6de4
3 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -324,7 +324,7 @@ FixIt theme assets partial
{{- $configJS = add $configJS "console.log('Page config:', window.config);" -}}
{{- end -}}
{{- $targetPath := $noBaseRelPermalink | printf "%s/config/page.js" -}}
{{- if (path.Ext .Page.RelPermalink) -}}
{{- if (path.Ext .Page.RelPermalink) | or .IsHome -}}
{{- $targetPath = "" -}}
{{- end -}}
{{- dict "Content" $configJS "Path" $targetPath "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
@@ -332,7 +332,7 @@ FixIt theme assets partial
{{- /* MathJax plugin */ -}}
{{- if .Store.Get "hasMathJax" -}}
{{- $targetPath := $noBaseRelPermalink | printf "%s/mathjax.min.js" -}}
{{- if (path.Ext .Page.RelPermalink) -}}
{{- if (path.Ext .Page.RelPermalink) | or .IsHome -}}
{{- $targetPath = "" -}}
{{- end -}}
{{- $options := dict "targetPath" $targetPath "minify" hugo.IsProduction -}}
+2
View File
@@ -57,6 +57,8 @@
<description>
{{- $content := dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" }}
{{- /* {{- $content | replaceRE `<figure[^>]*>.*</figure>` "" | replaceRE `<img[^>]*( /)?>` "" | safeHTML -}} */ -}}
{{- /* Hide line number column of code block */ -}}
{{- $content = $content | replaceRE `(<table class="lntable"[^>]*>.*?<td class="lntd")` `${1} style="display:none"` }}
{{- with $image }}
{{- $content = add (printf "<img src=%q alt=%q referrerpolicy=%q>" . "featured image" "no-referrer") $content | safeHTML }}
{{- end }}
+1 -1
View File
@@ -101,7 +101,7 @@
{{- /* Insert config */ -}}
{{- $targetPath := (strings.TrimPrefix (relURL "") $.RelPermalink) | printf "%s/config/post-chat.js" -}}
{{- if (path.Ext .Page.RelPermalink) -}}
{{- if (path.Ext .Page.RelPermalink) | or .IsHome -}}
{{- $targetPath = "" -}}
{{- end -}}
{{- dict "Content" $configJS "Path" $targetPath "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}