summaryrefslogtreecommitdiffstats
path: root/helpers/pygments.go
diff options
context:
space:
mode:
authorbep <bjorn.erik.pedersen@gmail.com>2015-04-14 19:58:37 +0200
committerbep <bjorn.erik.pedersen@gmail.com>2015-04-14 19:58:33 +0200
commitbe540f5b8fb340f1edfb1ed10c11334bbb85927b (patch)
tree4cf0a61d4fb79b1e34563f2d1b3651fb02f56f3e /helpers/pygments.go
parent0fcb78e43bbf7ac00b0cc72c5813a08942c1fe51 (diff)
Fix potential Windows path issue with Pygments cache
Diffstat (limited to 'helpers/pygments.go')
-rw-r--r--helpers/pygments.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/helpers/pygments.go b/helpers/pygments.go
index ca588870a..8223759c5 100644
--- a/helpers/pygments.go
+++ b/helpers/pygments.go
@@ -20,6 +20,7 @@ import (
"io"
"io/ioutil"
"os/exec"
+ "path/filepath"
"strings"
"github.com/spf13/hugo/hugofs"
@@ -62,7 +63,7 @@ func Highlight(code string, lexer string) string {
io.WriteString(hash, style)
io.WriteString(hash, noclasses)
- cachefile := fmt.Sprintf("%s/pygments-%x", viper.GetString("CacheDir"), hash.Sum(nil))
+ cachefile := filepath.Join(viper.GetString("CacheDir"), fmt.Sprintf("pygments-%x", hash.Sum(nil)))
exists, err := Exists(cachefile, fs)
if err != nil {
jww.ERROR.Print(err.Error())