all repos — homestead @ 526f9fe622c1067aee1877517dbca176796cd4e2

Code for my website

wip: render posts and lists

Alan Pearce
commit

526f9fe622c1067aee1877517dbca176796cd4e2

parent

71cec0c104f5c01efbdd3913ef5e51c90a70b57e

1 file changed, 38 insertions(+), 0 deletions(-)

changed files
A src/config.go
@@ -0,0 +1,38 @@
+package main + +import ( + "github.com/BurntSushi/toml" +) + +type Taxonomy struct { + Name string + Feed bool +} + +type MenuItem struct { + Name string + URL string `toml:"url"` +} + +type Config struct { + DefaultLanguage string `toml:"default_language"` + BaseURL string `toml:"base_url"` + RedirectOtherHostnames bool `toml:"redirect_other_hostnames"` + Title string + Email string + Description string + DomainStartDate string `toml:"domain_start_date"` + OriginalDomain string `toml:"original_domain"` + Taxonomies []Taxonomy + Extra struct { + Headers map[string]string + } + Menus map[string][]MenuItem +} + +func getConfig() Config { + config := Config{} + _, err := toml.DecodeFile("config.toml", &config) + check(err) + return config +}