flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit 7dbd33126b29caac5ffbfd9fa34ead2afb2a406f
parent 976db1036ed6aa057228c685bcd74a15a38180b6
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Tue, 15 Dec 2020 20:44:40 -0800

add untitled feeds

Diffstat:
Mgemfeed.go | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/gemfeed.go b/gemfeed.go @@ -46,6 +46,9 @@ func getAllGemfeedEntries() ([]*FeedEntry, error) { f.Close() if err == nil { feed.Creator = creator + if feed.Title == "" { + feed.Title = "(Untitled Feed)" + } feed.Url = &baseUrl feedEntries = append(feedEntries, feed.Entries...) } @@ -101,6 +104,9 @@ func ParseGemfeed(text io.Reader, baseUrl url.URL, limit int) (*Gemfeed, error) if time.Now().After(date) { title := strings.Trim(splits[1][10:], " -\t") fe := FeedEntry{title, parsedUrl, date, dateString, &gf} + if fe.Title == "" { + fe.Title = "(Untitled)" + } gf.Entries = append(gf.Entries, &fe) } }