mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-19 09:14:13 +00:00
Fix potential Windows path issue with Pygments cache
This commit is contained in:
parent
0fcb78e43b
commit
be540f5b8f
1 changed files with 2 additions and 1 deletions
|
@ -20,6 +20,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/hugo/hugofs"
|
"github.com/spf13/hugo/hugofs"
|
||||||
|
@ -62,7 +63,7 @@ func Highlight(code string, lexer string) string {
|
||||||
io.WriteString(hash, style)
|
io.WriteString(hash, style)
|
||||||
io.WriteString(hash, noclasses)
|
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)
|
exists, err := Exists(cachefile, fs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jww.ERROR.Print(err.Error())
|
jww.ERROR.Print(err.Error())
|
||||||
|
|
Loading…
Reference in a new issue