Skip to content

Commit b3f909c

Browse files
committed
Merge branch 'vasilevich-master'
2 parents 6933808 + ba993bc commit b3f909c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

build/pug.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const isPug = (filename) => {
4343
}
4444

4545
const compile = (filename, basedir) => {
46-
const levels = filename.replace('pug/views/', '').replace('pug/pages/', '').split('/').length
46+
const levels = filename.replace(`pug${path.sep}views${path.sep}`, '').replace(`pug${path.sep}pages${path.sep}`, '').split(`${path.sep}`).length
4747
const base = (levels) => {
4848
let path = './'
4949
while (levels > 1) {
@@ -83,9 +83,9 @@ const compileHtml = () => {
8383
const html = compile(view, './pug/layout/')
8484
let file
8585
if (version === 'ajax') {
86-
file = view.replace('pug/', '').replace('.pug', '.html')
86+
file = view.replace(`pug${path.sep}`, '').replace('.pug', '.html')
8787
} else {
88-
file = view.replace('pug/views/', '').replace('.pug', '.html')
88+
file = view.replace(`pug${path.sep}views${path.sep}`, '').replace('.pug', '.html')
8989
}
9090
// Create tree
9191
mkdirp.sync(resolve(dest, dirname(file)))
@@ -103,7 +103,7 @@ const compileHtml = () => {
103103
pages.forEach((page) => {
104104
if (isPug(page)) {
105105
const html = compile(page, './pug/layout/')
106-
const file = page.replace('pug/pages/', '').replace('.pug', '.html')
106+
const file = page.replace(`pug${path.sep}pages${path.sep}`, '').replace('.pug', '.html')
107107
// Create tree
108108
mkdirp.sync(resolve(dest, dirname(file)))
109109
// Create HTML file

0 commit comments

Comments
 (0)