about summary refs log tree commit diff stats
path: root/internal/config/config.go
blob: aa46e6a9c9c112d56bf1bc7d7383f064fc5e3594 (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
package config

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() (error, Config) {
	config := Config{}
	_, err := toml.DecodeFile("config.toml", &config)
	return err, config
}