all repos — vite @ 0a9ef15d9a968265eb9c4af1748ef7ab385d1901

a fast (this time, actually) and minimal static site generator

config.go (view raw)

 1package main
 2
 3import (
 4	"gopkg.in/yaml.v2"
 5	"io/ioutil"
 6)
 7
 8type Config struct {
 9	Title     string
10	Header    string
11	Footer    string
12	Prebuild  []string
13	Postbuild []string
14}
15
16func parseConfig() Config {
17	var config Config
18	cf, err := ioutil.ReadFile("config.yaml")
19	if err != nil {
20		printErr(err)
21	}
22
23	err = yaml.Unmarshal(cf, &config)
24	if err != nil {
25		printErr(err)
26	}
27
28	return config
29}