From 56b0df9e6c84bbcdaffbde50632e7fdd992791e5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 15 Apr 2024 08:55:53 +0200 Subject: wip: render feeds --- internal/config/config.go | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 internal/config/config.go (limited to 'internal/config') diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..aa46e6a --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1,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 +} -- cgit 1.4.1