diff options
Diffstat (limited to 'utils.go')
-rw-r--r-- | utils.go | 20 |
1 files changed, 20 insertions, 0 deletions
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 +} |