all repos — flounder @ 7dbd33126b29caac5ffbfd9fa34ead2afb2a406f

A small site builder for the Gemini protocol

add untitled feeds
alex wennerberg alex@alexwennerberg.com
Tue, 15 Dec 2020 20:44:40 -0800
commit

7dbd33126b29caac5ffbfd9fa34ead2afb2a406f

parent

976db1036ed6aa057228c685bcd74a15a38180b6

1 files changed, 6 insertions(+), 0 deletions(-)

jump to
M gemfeed.gogemfeed.go

@@ -46,6 +46,9 @@ feed, err := ParseGemfeed(f, baseUrl, maxUserItems) // TODO make configurable

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 @@ parsedUrl.Scheme = ""

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) } }