about summary refs log tree commit diff stats
path: root/src/config.go
blob: bfa3052a52602af18e33a8c3d575091dcf69f233 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
}