Пример #1
0
func runServer(args []string) {
	config := builder.NewSiteConfig(args)
	site := builder.NewSite(config, nil)
	watcher := site.MakeWatcher(func() {
		site.InitGenerate()
	})
	webserver := site.MakeWebserver()
	if err := watcher.Watch(); err != nil {
		log.Fatalln(err)
	}
	if err := webserver.Serve(); err != nil {
		log.Fatalln(err)
	}
}
Пример #2
0
func runBuild(args []string) {
	config := builder.NewSiteConfig(args)
	site := builder.NewSite(config, nil)
	site.GenerateFiles()
}