From 825c253494a4930780e90dafa0a91ffed6debc08 Mon Sep 17 00:00:00 2001 From: Petter Rodhelind Date: Sun, 21 Feb 2021 21:11:14 +0100 Subject: Add RSS link in HTML footer. --- main.go | 5 +++++ templates.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0e7dbba..a491337 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ var outputMode string type channel struct { Title string Link string + Name string Description string Items []*post } @@ -29,6 +30,8 @@ func (c *channel) String() string { s = strings.Replace(template, "{{title}}", c.Title, -1) s = strings.Replace(s, "{{link}}", c.Link, -1) s = strings.Replace(s, "{{description}}", c.Description, -1) + s = strings.Replace(s, "{{name}}", c.Name, -1) + var items string for i := range c.Items { item := c.Items[i].String() @@ -81,6 +84,8 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } + c.Name = group + fmt.Fprintf(w, "%s\n", c.String()) } diff --git a/templates.go b/templates.go index 5168c1a..0537f7c 100644 --- a/templates.go +++ b/templates.go @@ -63,7 +63,7 @@ const htmlRoot = `
-- cgit v1.2.3