Can now generate a lot of the static content from templates in pages/ WARNING: I kept seeing page _templates_ getting corrupted on rendering, which is no bueno.
This commit is contained in:
parent
7e48768e36
commit
c64874cb51
12 changed files with 516 additions and 608 deletions
|
@ -2,10 +2,24 @@ package main
|
|||
|
||||
import (
|
||||
"log"
|
||||
"flag"
|
||||
"zedshaw.games/webapp/zed"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.Println("Generating site from pages to public.")
|
||||
zed.RenderPages("./pages", "./public", "layouts/main")
|
||||
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.")
|
||||
|
||||
zed.RenderPages(cfg.source, cfg.target, cfg.layouts)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue