Do not create feed title for untitled posts

This commit is contained in:
Angelo Stavrow 2021-04-23 11:30:21 -04:00
parent c0fdd8af49
commit b7b106d9db
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
1 changed files with 5 additions and 1 deletions

View File

@ -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),