all repos — vite @ ddc00185b9902d70c044b9dd09eabd2dc30ca6e0

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}