fast and minimal static site generator
ssg

Add ability to mark posts as draft

These will be skipped during build stage.

anirudh.fi cf6acc3b 45310dfe

verified
+6 -1
-1
commands/build.go
··· 111 111 if err := util.CopyDir(types.StaticDir, buildStatic); err != nil { 112 112 return err 113 113 } 114 - fmt.Println("done") 115 114 116 115 return nil 117 116 }
+1
commands/new.go
··· 19 19 title: 20 20 subtitle: 21 21 date: %s 22 + draft: true 22 23 ---`, url, time.Now().Format("2006-01-02")) 23 24 24 25 if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) {
+5
formats/markdown/markdown.go
··· 107 107 return fmt.Errorf("markdown: error extracting frontmatter: %w", err) 108 108 } 109 109 110 + if md.frontmatter["draft"] == "true" { 111 + fmt.Printf("vite: skipping draft %s\n", md.Path) 112 + return nil 113 + } 114 + 110 115 err = md.template(dest, types.TemplatesDir, templateData{ 111 116 config.Config, 112 117 md.frontmatter,