mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +02:00
Fix Windows Ace path issue
Ace doesn't like Windows style filepath separators. Fixes #1178
This commit is contained in:
@@ -161,6 +161,11 @@ func (t *GoHTMLTemplate) AddTemplate(name, tpl string) error {
|
|||||||
func (t *GoHTMLTemplate) AddAceTemplate(name, basePath, innerPath string, baseContent, innerContent []byte) error {
|
func (t *GoHTMLTemplate) AddAceTemplate(name, basePath, innerPath string, baseContent, innerContent []byte) error {
|
||||||
var base, inner *ace.File
|
var base, inner *ace.File
|
||||||
name = name[:len(name)-len(filepath.Ext(innerPath))] + ".html"
|
name = name[:len(name)-len(filepath.Ext(innerPath))] + ".html"
|
||||||
|
|
||||||
|
// Fixes issue #1178
|
||||||
|
basePath = strings.Replace(basePath, "\\", "/", -1)
|
||||||
|
innerPath = strings.Replace(innerPath, "\\", "/", -1)
|
||||||
|
|
||||||
if basePath != "" {
|
if basePath != "" {
|
||||||
base = ace.NewFile(basePath, baseContent)
|
base = ace.NewFile(basePath, baseContent)
|
||||||
inner = ace.NewFile(innerPath, innerContent)
|
inner = ace.NewFile(innerPath, innerContent)
|
||||||
|
Reference in New Issue
Block a user