konstrui/main.go
main.goRaw
1package main
2
3import (
4 "fmt"
5 "os"
6)
7
8const rawFolderPath = "./webInput"
9const konstruiConfigFile = "konstruiConfig.json"
10
11func main() {
12 c.Green("getting files from /webInput")
13 c.Green("getting conifg from file konstruiConfig.json")
14
15 //READ CONFIG: konstruiConfig.json
16 konstruiConfigs := readKonstruiConfig(rawFolderPath + "/" + konstruiConfigFile)
17 c.Green("configuration:")
18 fmt.Println(konstruiConfigs)
19 c.Green("templating")
20
21 //create directory webOutput
22 _ = os.Mkdir("webOutput", os.ModePerm)
23
24 //DO TEMPLATING
25 for _, konstruiConfig := range konstruiConfigs {
26 _ = os.Mkdir(konstruiConfig.OutputDir, os.ModePerm)
27 startTemplating(rawFolderPath, konstruiConfig.OutputDir, konstruiConfig)
28 }
29 c.Green("webpage finished, files at /webOutput")
30}