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

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

Loading…
Cancel
Save