Better date formatting
Anirudh Oppiliappan x@icyphox.sh
Tue, 01 Dec 2020 18:42:40 +0530
1 files changed,
19 insertions(+),
2 deletions(-)
jump to
M
build.go
→
build.go
@@ -69,11 +69,28 @@ if strings.Contains(relPath, "blog/") {
posts = append(posts, Post{fm}) } + type NewFm struct { + Template string + URL string + Title string + Subtitle string + Date string + Body string + } + + var newFm = NewFm { + fm.Template, + fm.URL, + fm.Title, + fm.Subtitle, + fm.Date.Time.Format("02 January, 2006"), + fm.Body, + } // combine config and matter structs combined := struct { Cfg Config - Fm Matter - }{cfg, fm} + Fm NewFm + }{cfg, newFm} htmlFile, err := os.Create(filepath.Join(buildPath, "index.html")) if err != nil {