shithub: hugo

Download patch

ref: f01505c910a325acc18742ac6b3637aa01975e37
parent: 8278384b9680cfdcecef9c668638ad483012857f
author: Bjørn Erik Pedersen <[email protected]>
date: Fri Jul 20 04:00:26 EDT 2018

resource/scss: Fix source maps on Windows

I have tested this OK on

* Windows 10 (it did not work before this commit)
* MacOS

Fixes #4968

--- a/resource/tocss/scss/tocss.go
+++ b/resource/tocss/scss/tocss.go
@@ -19,6 +19,7 @@
 	"fmt"
 	"io"
 	"path"
+	"path/filepath"
 	"strings"
 
 	"github.com/bep/go-tocss/scss"
@@ -83,6 +84,10 @@
 		if strings.HasPrefix(sourcePath, t.c.rs.WorkingDir) {
 			sourcePath = strings.TrimPrefix(sourcePath, t.c.rs.WorkingDir+helpers.FilePathSeparator)
 		}
+
+		// This needs to be Unix-style slashes, even on Windows.
+		// See https://github.com/gohugoio/hugo/issues/4968
+		sourcePath = filepath.ToSlash(sourcePath)
 
 		// This is a workaround for what looks like a bug in Libsass. But
 		// getting this resolution correct in tools like Chrome Workspaces