all repos — website @ 93c01942cb379b448dafab7ceffd78c005772928

My website

builder:make getHTMLStyleHash output-independent

Alan Pearce
commit

93c01942cb379b448dafab7ceffd78c005772928

parent

160a6e5084ed3c2a6d9ec3831325d3607cc222c1

1 file changed, 6 insertions(+), 2 deletions(-)

changed files
M internal/builder/builder.gointernal/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")