about summary refs log tree commit diff stats
path: root/internal/builder
diff options
context:
space:
mode:
Diffstat (limited to 'internal/builder')
-rw-r--r--internal/builder/builder.go8
-rw-r--r--internal/builder/template.go10
2 files changed, 8 insertions, 10 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")
diff --git a/internal/builder/template.go b/internal/builder/template.go
index c318107..914b67d 100644
--- a/internal/builder/template.go
+++ b/internal/builder/template.go
@@ -155,14 +155,8 @@ func getFeedStylesHash(r io.Reader) (string, error) {
 	return hash(style.InnerText()), nil
 }
 
-func getHTMLStyleHash(filenames ...string) (string, error) {
-	fn := filepath.Join(filenames...)
-	f, err := os.Open(fn)
-	if err != nil {
-		return "", err
-	}
-	defer f.Close()
-	doc, err := NewDocumentFromReader(f)
+func getHTMLStyleHash(r io.Reader) (string, error) {
+	doc, err := NewDocumentFromReader(r)
 	if err != nil {
 		return "", err
 	}