all repos — vite @ 1e6bde1d6ac06b0921c56a935ddeaa4c8775e055

a fast (this time, actually) and minimal static site generator

Better date formatting
Anirudh Oppiliappan x@icyphox.sh
Tue, 01 Dec 2020 18:42:40 +0530
commit

1e6bde1d6ac06b0921c56a935ddeaa4c8775e055

parent

8fb48f7b232232744deffbb72cfeac93cad0f32a

1 files changed, 19 insertions(+), 2 deletions(-)

jump to
M build.gobuild.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 {