about summary refs log tree commit diff stats
path: root/internal/config/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go37
1 files changed, 37 insertions, 0 deletions
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
+}