···16161717options:
1818 init PATH create vite project at PATH
1919- build builds the current project
1919+ build [--drafts] builds the current project
2020 new PATH create a new markdown post
2121 serve [HOST:PORT] serves the 'build' directory
2222`
···3838 }
39394040 case "build":
4141- if err := commands.Build(); err != nil {
4141+ var drafts bool
4242+ if len(args) > 2 && args[2] == "--drafts" {
4343+ drafts = true
4444+ }
4545+ if err := commands.Build(drafts); err != nil {
4246 fmt.Fprintf(os.Stderr, "error: build: %+v\n", err)
4347 }
4448
+1-1
types/types.go
···1313 // page frontmatter and the body, as template params. Templates are read
1414 // from types.TemplateDir and the final html is written to dest,
1515 // with necessary directories being created.
1616- Render(dest string, data interface{}) error
1616+ Render(dest string, data interface{}, drafts bool) error
17171818 // Frontmatter will not be populated if Render hasn't been called.
1919 Frontmatter() map[string]string