builder:make getHTMLStyleHash output-independent
1 file changed, 6 insertions(+), 2 deletions(-)
changed files
M internal/builder/builder.go → internal/builder/builder.go
@@ -39,7 +39,6 @@ output := outputs.NewFilesOutput(ioConfig.Destination, log, &outputs.Options{ CompressFiles: !ioConfig.Development, }) - outDir := ioConfig.Destination joinSource := joinSourcePath(ioConfig.Source) log.Debug("output", "dir", ioConfig.Destination)@@ -168,7 +167,12 @@ // it would be nice to set LastMod here, but using the latest post // 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")