From 00792ce0077bd52aa31306dccc7cbb6c1d1e9764 Mon Sep 17 00:00:00 2001 From: Timur Demin Date: Sun, 3 Oct 2021 11:06:19 +0500 Subject: [PATCH 1/2] Print full post content in RSS description As gmnhg right now doesn't generate post summary, using post content as RSS post description source seems like our best bet. Right now gmnhg will generate RSS with empty descriptions. --- cmd/gmnhg/templates.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gmnhg/templates.go b/cmd/gmnhg/templates.go index e34481b..76c9c01 100644 --- a/cmd/gmnhg/templates.go +++ b/cmd/gmnhg/templates.go @@ -79,7 +79,7 @@ var defaultRssTemplate = mustParseTmpl("rss", `{{- $Site := .Site -}} {{ $AbsURL }} {{ $p.Metadata.Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" }} {{ $AbsURL }} - {{ html $p.Metadata.Summary }} + {{ printf "%s" $p.Post }} {{end}}{{end}} From f1811f9e60d862b4389dcd3d2737a3cd8aa0be1b Mon Sep 17 00:00:00 2001 From: Timur Demin Date: Thu, 4 Nov 2021 23:48:03 +0500 Subject: [PATCH 2/2] Escape XML in RSS contents --- cmd/gmnhg/templates.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gmnhg/templates.go b/cmd/gmnhg/templates.go index 76c9c01..a8806e2 100644 --- a/cmd/gmnhg/templates.go +++ b/cmd/gmnhg/templates.go @@ -79,7 +79,7 @@ var defaultRssTemplate = mustParseTmpl("rss", `{{- $Site := .Site -}} {{ $AbsURL }} {{ $p.Metadata.Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" }} {{ $AbsURL }} - {{ printf "%s" $p.Post }} + {{ printf "%s" $p.Post | html }} {{end}}{{end}}