about summary refs log tree commit diff stats
path: root/internal/builder/builder.go
diff options
context:
space:
mode:
authorAlan Pearce2025-01-25 21:50:20 +0100
committerAlan Pearce2025-01-25 21:50:20 +0100
commit93c01942cb379b448dafab7ceffd78c005772928 (patch)
treecc2ea749569677ed8a283772551c8cb9d4350817 /internal/builder/builder.go
parent160a6e5084ed3c2a6d9ec3831325d3607cc222c1 (diff)
downloadwebsite-93c01942cb379b448dafab7ceffd78c005772928.tar.lz
website-93c01942cb379b448dafab7ceffd78c005772928.tar.zst
website-93c01942cb379b448dafab7ceffd78c005772928.zip
builder:make getHTMLStyleHash output-independent
Diffstat (limited to 'internal/builder/builder.go')
-rw-r--r--internal/builder/builder.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/builder/builder.go b/internal/builder/builder.go
index 7c1911e..6e5cfc9 100644
--- a/internal/builder/builder.go
+++ b/internal/builder/builder.go
@@ -39,7 +39,6 @@ func build(ioConfig *IOConfig, config *config.Config, log *log.Logger) (*Result,
 		CompressFiles: !ioConfig.Development,
 	})
 
-	outDir := ioConfig.Destination
 	joinSource := joinSourcePath(ioConfig.Source)
 
 	log.Debug("output", "dir", ioConfig.Destination)
@@ -168,7 +167,12 @@ func build(ioConfig *IOConfig, config *config.Config, log *log.Logger) (*Result,
 	// date would be wrong as the homepage has its own content file
 	// without a date, which could be newer
 	sitemap.AddPath("/", time.Time{})
-	h, _ = getHTMLStyleHash(outDir, "index.html")
+	f, err := output.Open("index.html")
+	if err != nil {
+		return nil, err
+	}
+	defer f.Close()
+	h, _ = getHTMLStyleHash(f)
 	r.Hashes = append(r.Hashes, h)
 
 	log.Debug("rendering sitemap")