From ce81b97e80ada42a223a7fd45c5abaa5c9667d75 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sat, 25 Jan 2020 18:35:06 +0100 Subject: Added entry processing, stubs for page processing, basic utils, empty main --- utils.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 utils.go (limited to 'utils.go') diff --git a/utils.go b/utils.go new file mode 100644 index 0000000..7157072 --- /dev/null +++ b/utils.go @@ -0,0 +1,20 @@ +package main + +import ( + "github.com/BurntSushi/toml" + "strings" +) + +type config struct { + docsRoot string + templateFile string + targetDir string + cssFile string + baseUrl string +} + +func readConfig(file string) (cfg config, err error) { + _, err = toml.DecodeFile(file, &cfg) + cfg.baseUrl = strings.TrimSuffix(cfg.baseUrl, "/") + return +} -- cgit v1.2.3