From 93c01942cb379b448dafab7ceffd78c005772928 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 25 Jan 2025 21:50:20 +0100 Subject: builder:make getHTMLStyleHash output-independent --- internal/builder/builder.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'internal/builder/builder.go') 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") -- cgit 1.4.1