···1515A simple and minimal static site generator.
16161717options:
1818- init PATH create vite project at PATH
1919- build builds the current project
2020- new PATH create a new markdown post
2121- `
1818+ init PATH create vite project at PATH
1919+ build builds the current project
2020+ new PATH create a new markdown post
2121+ serve [HOST:PORT] serves the 'build' directory
2222+`
22232324 if len(args) <= 1 {
2425 fmt.Println(helpStr)
···3233 return
3334 }
3435 initPath := args[2]
3535- err := commands.Init(initPath)
3636- if err != nil {
3636+ if err := commands.Init(initPath); err != nil {
3737 fmt.Fprintf(os.Stderr, "error: init: %+v\n", err)
3838 }
39394040 case "build":
4141- err := commands.Build()
4242- if err != nil {
4141+ if err := commands.Build(); err != nil {
4342 fmt.Fprintf(os.Stderr, "error: build: %+v\n", err)
4443 }
4544···4948 return
5049 }
5150 newPath := args[2]
5252- err := commands.New(newPath)
5353- if err != nil {
5151+ if err := commands.New(newPath); err != nil {
5452 fmt.Fprintf(os.Stderr, "error: new: %+v\n", err)
5553 }
5454+ case "serve":
5555+ var addr string
5656+ if len(args) == 3 {
5757+ addr = args[2]
5858+ } else {
5959+ addr = ":9191"
6060+ }
6161+ if err := commands.Serve(addr); err != nil {
6262+ fmt.Fprintf(os.Stderr, "error: serve: %+v\n", err)
6363+ }
6464+ default:
6565+ fmt.Println(helpStr)
5666 }
57675868}
+4-3
readme
···1515 A simple and minimal static site generator.
16161717 options:
1818- init PATH create vite project at PATH
1919- build builds the current project
2020- new PATH create a new markdown post
1818+ init PATH create vite project at PATH
1919+ build builds the current project
2020+ new PATH create a new markdown post
2121+ serve [HOST:PORT] serves the 'build' directory
212222232324CONFIG