From 2efb35d927a8e4fb50ce1b742e9078bcd950265e Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Tue, 10 Nov 2020 20:09:32 +0100 Subject: [PATCH] Specify published, updated via frontmatter --- micropub.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/micropub.go b/micropub.go index 75054a2..cf966a6 100644 --- a/micropub.go +++ b/micropub.go @@ -350,6 +350,14 @@ func (p *post) computeExtraPostParameters() error { p.Slug = slug[0] delete(p.Parameters, "slug") } + if published := p.Parameters["published"]; len(published) == 1 && published[0] != "" { + p.Published = published[0] + delete(p.Parameters, "published") + } + if updated := p.Parameters["updated"]; len(updated) == 1 && updated[0] != "" { + p.Updated = updated[0] + delete(p.Parameters, "updated") + } if p.Path == "" && p.Section == "" { // Has no path or section -> default section p.Section = appConfig.Blogs[p.Blog].DefaultSection