zedshaw.games/tools/cmd/sitebuild/main.go

25 lines
603 B
Go

package main
import (
"log"
"flag"
"zedshaw.games/webapp/common"
)
type config struct {
source string
target string
layouts string
}
func main() {
var cfg config
flag.StringVar(&cfg.source, "source", "./pages", "The templates to load and process.")
flag.StringVar(&cfg.target, "target", "./public", "The target to write the resulting content.")
flag.StringVar(&cfg.layouts, "layouts", "layouts/main", "The default layout to use, must be a template in <source>")
log.Println("Generating site from pages to public.")
common.RenderPages(cfg.source, cfg.target, cfg.layouts)
}