From 3eab65c59b945399530e3ff5e1a0e337e18d65fc Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 13 Jan 2026 18:09:32 +0000 Subject: [PATCH] Removing graphs from RSS feed --- layouts/rss.xml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/layouts/rss.xml b/layouts/rss.xml index 1689636..8303298 100644 --- a/layouts/rss.xml +++ b/layouts/rss.xml @@ -6,7 +6,6 @@ {{- end }} {{- end }} {{- end }} - {{- $authorName := "" }} {{- with site.Params.author }} {{- if reflect.IsMap . }} @@ -17,7 +16,6 @@ {{- $authorName = . }} {{- end }} {{- end }} - {{- $pctx := . }} {{- if .IsHome }}{{ $pctx = .Site }}{{ end }} {{- $pages := slice }} @@ -32,24 +30,27 @@ {{- end }} {{- printf "" | safeHTML }} - - Blog(gish) by Dan @ ritual.sh - {{ .Permalink }} - Dan's thoughts on web and game development, tech experiments, and whatever else catches my attention in the Golden Valley. - {{ site.Language.LanguageCode }}{{ if not .Date.IsZero }} - {{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + +Blog(gish) by Dan @ ritual.sh +{{ .Permalink }} +Dan's thoughts on web and game development, tech experiments, and whatever else catches my attention in the Golden Valley. +{{ site.Language.LanguageCode }}{{ if not .Date.IsZero }} +{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{- with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{- end }} {{- range $pages }} - - {{ .Title }} - {{ .Permalink }} - {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- $content := .Content }} + {{- /* Remove graph containers with all their content including canvas and script tags */ -}} + {{- $content = replaceRE `(?s)
]*>.*?
\s*` "

[Interactive graph not available in RSS - please visit the full post to view the charts]

" $content }} + +{{ .Title }} +{{ .Permalink }} +{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} - {{ .Permalink }} - {{ .Content | transform.XMLEscape | safeHTML }} - +{{ .Permalink }} +{{ $content | transform.XMLEscape }} +
{{- end }} -
-
+ + \ No newline at end of file