about summary refs log tree commit diff stats
path: root/cmd/build
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/build')
-rw-r--r--cmd/build/main.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/build/main.go b/cmd/build/main.go
index 14175e9..39cbc1b 100644
--- a/cmd/build/main.go
+++ b/cmd/build/main.go
@@ -5,6 +5,7 @@ import (
 	"os"
 
 	"go.alanpearce.eu/website/internal/builder"
+	"go.alanpearce.eu/website/internal/config"
 	"go.alanpearce.eu/website/internal/log"
 
 	"github.com/ardanlabs/conf/v3"
@@ -20,7 +21,7 @@ func main() {
 		}
 		panic("error parsing configuration: " + err.Error())
 	}
-	log.Configure(!ioConfig.Development)
+	log := log.Configure(!ioConfig.Development)
 
 	log.Debug("starting build process")
 	if ioConfig.Source != "." {
@@ -29,7 +30,12 @@ func main() {
 			log.Panic("could not change to source directory")
 		}
 	}
-	_, err := builder.BuildSite(ioConfig, nil)
+	cfg, err := config.GetConfig(ioConfig.Source, log)
+	if err != nil {
+		log.Error("could not read config", "error", err)
+	}
+
+	_, err = builder.BuildSite(ioConfig, cfg, log)
 	if err != nil {
 		log.Error("could not build site", "error", err)
 		os.Exit(1)