diff options
-rw-r--r-- | main.go | 5 | ||||
-rw-r--r-- | templates.go | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -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 = ` </main> <hr> <footer> - <small>Generated by fbfeed</small> + <small>Generated by fbfeed · <a href="/{{name}}.rss">rss feed</a></small> </footer> </body> |