diff --git a/database.go b/database.go index 3af063d..4e6ded5 100644 --- a/database.go +++ b/database.go @@ -661,7 +661,7 @@ func (db *datastore) CreatePost(userID, collID int64, post *SubmittedPost) (*Pos // SQLite stores datetimes in UTC, so convert time.Now() to it here created = created.UTC() } - if post.Created != nil { + if post.Created != nil && *post.Created != "" { created, err = time.Parse("2006-01-02T15:04:05Z", *post.Created) if err != nil { log.Error("Unable to parse Created time '%s': %v", *post.Created, err) diff --git a/feed.go b/feed.go index d85baf8..21e1302 100644 --- a/feed.go +++ b/feed.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -15,7 +15,7 @@ import ( "net/http" "time" - . "github.com/gorilla/feeds" + "github.com/gorilla/feeds" "github.com/gorilla/mux" stripmd "github.com/writeas/go-strip-markdown/v2" "github.com/writeas/web-core/log" @@ -87,11 +87,11 @@ func ViewFeed(app *App, w http.ResponseWriter, req *http.Request) error { siteURL += "tag:" + tag } - feed := &Feed{ + feed := &feeds.Feed{ Title: collectionTitle, - Link: &Link{Href: siteURL}, + Link: &feeds.Link{Href: siteURL}, Description: coll.Description, - Author: &Author{author, ""}, + Author: &feeds.Author{author, ""}, Created: time.Now(), } @@ -103,13 +103,13 @@ func ViewFeed(app *App, w http.ResponseWriter, req *http.Request) error { // Create the item for the feed title = p.PlainDisplayTitle() permalink = fmt.Sprintf("%s%s", baseUrl, p.Slug.String) - feed.Items = append(feed.Items, &Item{ + feed.Items = append(feed.Items, &feeds.Item{ Id: fmt.Sprintf("%s%s", basePermalinkUrl, p.Slug.String), Title: title, - Link: &Link{Href: permalink}, + Link: &feeds.Link{Href: permalink}, Description: "", Content: string(p.HTMLContent), - Author: &Author{author, ""}, + Author: &feeds.Author{author, ""}, Created: p.Created, Updated: p.Updated, }) diff --git a/less/core.less b/less/core.less index 75a801b..709ba1e 100644 --- a/less/core.less +++ b/less/core.less @@ -695,6 +695,7 @@ table.downloads { select.inputform, textarea.inputform { border: 1px solid #999; + background: white; } input, button, select.inputform, textarea.inputform, a.btn { diff --git a/postrender.go b/postrender.go index 13bf02e..b200a59 100644 --- a/postrender.go +++ b/postrender.go @@ -201,6 +201,9 @@ func applyBasicMarkdown(data []byte) string { md := blackfriday.Markdown(append([]byte("# "), data...), blackfriday.HtmlRenderer(htmlFlags, "", ""), mdExtensions) // Remove H1 markup md = bytes.TrimSpace(md) // blackfriday.Markdown adds a newline at the end of the