Commit 454da698 authored by Nick's avatar Nick

fix: git sync untracked

parent 30d800bc
......@@ -89,5 +89,18 @@ module.exports = {
} else {
return false
}
},
/**
* Get file extension from content type
*/
getFileExtension(contentType) {
switch (contentType) {
case 'markdown':
return 'md'
case 'html':
return 'html'
default:
return 'txt'
}
}
}
......@@ -159,14 +159,7 @@ module.exports = class Page extends Model {
* @returns {string} File Extension
*/
getFileExtension() {
switch (this.contentType) {
case 'markdown':
return 'md'
case 'html':
return 'html'
default:
return 'txt'
}
return pageHelper.getFileExtension(this.contentType)
}
/**
......
......@@ -349,7 +349,7 @@ module.exports = {
new stream.Transform({
objectMode: true,
transform: async (page, enc, cb) => {
let fileName = `${page.path}.${page.getFileExtension()}`
let fileName = `${page.path}.${pageHelper.getFileExtension(page.contentType)}`
if (WIKI.config.lang.namespacing && WIKI.config.lang.code !== page.localeCode) {
fileName = `${page.localeCode}/${fileName}`
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment