all repos — vite @ 5c55338e620638cada7c5415e54424a6480accf6

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            `yaml:"title"`
10	Header      string            `yaml:"header"`
11	SiteURL     string            `yaml:"siteurl"`
12	Description string            `yaml:"description"`
13	Author      map[string]string `yaml:"author"`
14	Footer      string            `yaml:"footer"`
15	Prebuild    []string          `yaml:"prebuild"`
16	Postbuild   []string          `yaml:"postbuild"`
17	RSSPrefixURL string			  `yaml:"rssprefixurl"`
18}
19
20func parseConfig() Config {
21	var config Config
22	cf, err := ioutil.ReadFile("config.yaml")
23	if err != nil {
24		printErr(err)
25	}
26
27	err = yaml.Unmarshal(cf, &config)
28	if err != nil {
29		printErr(err)
30	}
31
32	return config
33}