Author: Honza Pokorny <honza@pokorny.ca>
Add href to feed items This means that the id isn't auto-generated, and different each time you run the program. If the id is different, the item will always appear new and unread in your rss reader.
pkg/bookends/bookends.go | 10 ++++++++--
diff --git a/pkg/bookends/bookends.go b/pkg/bookends/bookends.go index cba1d3f05c7b4e2c3c3d8c68418a857d2b545933..1ff39c35340c763435c0fd223de6f4bb62970b0a 100644 --- a/pkg/bookends/bookends.go +++ b/pkg/bookends/bookends.go @@ -62,6 +62,10 @@ Review template.HTML Tags []string } +func (b *Book) Link(config AtomConfig) string { + return fmt.Sprintf("%s/feed/update/%s", config.Link, b.ISBN) +} + type BooksByDateRead []Book func (r BooksByDateRead) Len() int { return len(r) } @@ -208,8 +212,10 @@ var items []*feeds.Item for _, book := range books { item := &feeds.Item{ - Title: book.Title, - Link: &feeds.Link{}, + Title: book.Title, + // NOTE: if feeds.Link.Href is empty, each item will appear new each time + // the feed is updated + Link: &feeds.Link{Href: book.Link(config)}, Content: book.AtomContent(), Author: author, Created: book.DateRead,