diff options
author | Alan Pearce | 2024-04-14 22:42:33 +0200 |
---|---|---|
committer | Alan Pearce | 2024-04-16 18:10:11 +0200 |
commit | 42a838666aa9da0799dcd3c3d9c6ad0344d1e8d6 (patch) | |
tree | 70946e7a87c28ad676ee5e6297169d4bb16751d9 /src/config.go | |
parent | 4536e9e5dd826eb0e69c930312ba8f66e9c16175 (diff) | |
download | website-42a838666aa9da0799dcd3c3d9c6ad0344d1e8d6.tar.lz website-42a838666aa9da0799dcd3c3d9c6ad0344d1e8d6.tar.zst website-42a838666aa9da0799dcd3c3d9c6ad0344d1e8d6.zip |
wip: render posts and lists
Diffstat (limited to 'src/config.go')
-rw-r--r-- | src/config.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/config.go b/src/config.go new file mode 100644 index 0000000..bfa3052 --- /dev/null +++ b/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 +} |