bugfix for dirPath

main v0.2.0
HerrHase 2 years ago
parent ffbe2a5849
commit 494e79c86e

@ -45,12 +45,11 @@ class Page {
// adding filename for html as pathname and relative path in structure
this._filename = this._resolveFilename(file)
this._slug = this._resolveSlug(this._filename)
this._path = this._resolvePath(parent)
this._permalink = this._path
this._dirPath = this._resolvePath(parent)
this._permalink = this._dirPath
if (this._slug) {
this._permalink = this._path + '/' + this._slug
this._permalink = this._dirPath + '/' + this._slug
}
this._filename += '.' + this._fields.extensions
@ -70,7 +69,8 @@ class Page {
return assign({
'content' : this._content,
'blocks' : this._blocks,
'path' : this._path + '/' + this._filename,
'dirPath' : this._dirPath,
'path' : this._dirPath + '/' + this._filename,
'permalink' : this._permalink,
'filename' : this._filename
}, this._fields)

@ -104,8 +104,8 @@ class Siteomat {
}
// create directories and write file = page
mkdirp(this._destination + page.pathname).then(() => {
fs.writeFileSync(this._destination + page.pathname + '/' + page.filename, content)
mkdirp(this._destination + page.dirPath).then(() => {
fs.writeFileSync(this._destination + page.path, content)
})
sitemap.addPage(page)

Loading…
Cancel
Save