all repos — website @ b4095d108a2646bcf9e7fff64788b10d9bce8da3

My website

build outside of working directory

Alan Pearce
commit

b4095d108a2646bcf9e7fff64788b10d9bce8da3

parent

e8221541404a8d2ca0758d48ba5fe9c85f9067ac

1 file changed, 5 insertions(+), 3 deletions(-)

changed files
M internal/config/config.gointernal/config/config.go
@@ -3,6 +3,7 @@
import ( "io/fs" "net/url" + "path/filepath" "website/internal/log" "github.com/BurntSushi/toml"
@@ -49,10 +50,11 @@ }
Menus map[string][]MenuItem } -func GetConfig() (*Config, error) { +func GetConfig(dir string) (*Config, error) { config := Config{} - log.Debug("reading config.toml") - _, err := toml.DecodeFile("config.toml", &config) + filename := filepath.Join(dir, "config.toml") + log.Debug("reading config", "filename", filename) + _, err := toml.DecodeFile(filename, &config) if err != nil { switch t := err.(type) { case *fs.PathError: