From b7b106d9db02d18fcc7c4913064c8629de8ebdee Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Fri, 23 Apr 2021 11:30:21 -0400 Subject: [PATCH] Do not create feed title for untitled posts --- feed.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/feed.go b/feed.go index 3062e26..18bd58a 100644 --- a/feed.go +++ b/feed.go @@ -97,7 +97,11 @@ func ViewFeed(app *App, w http.ResponseWriter, req *http.Request) error { var title, permalink string for _, p := range *coll.Posts { - title = p.PlainDisplayTitle() + if p.Title.String != "" { + title = p.PlainDisplayTitle() + } else { + title = "" + } permalink = fmt.Sprintf("%s%s", baseUrl, p.Slug.String) feed.Items = append(feed.Items, &Item{ Id: fmt.Sprintf("%s%s", basePermalinkUrl, p.Slug.String),