Add <h2> to RSS for subtitles
Anirudh Oppiliappan x@icyphox.sh
Mon, 16 Aug 2021 22:25:26 +0530
1 files changed,
7 insertions(+),
2 deletions(-)
jump to
M
atom/feed.go
→
atom/feed.go
@@ -72,8 +72,13 @@ cfg.URL[8:], // strip https://
dateStr, filepath.Join(srcDir, p.Meta["slug"]), ), - Link: &AtomLink{Href: filepath.Join(cfg.URL, srcDir, p.Meta["slug"])}, - Summary: &AtomSummary{Content: string(p.HTML), Type: "html"}, + Link: &AtomLink{Href: filepath.Join(cfg.URL, srcDir, p.Meta["slug"])}, + Summary: &AtomSummary{ + Content: fmt.Sprintf("<h2>%s</h2>\n%s", + p.Meta["subtitle"], + string(p.HTML)), + Type: "html", + }, } entries = append(entries, entry) }