feat: delete user with replace target

This commit is contained in:
NGPixel committed 2020-05-30 16:34:09 -04:00
1 parent 006dae1221
commit 1f9e5b3fd0
15 files changed
+165 -92

No files matched your search

+7 -1
View File
@@ -71,13 +71,19 @@ module.exports = {
['description', page.description],
['published', page.isPublished.toString()],
['date', page.updatedAt],
['tags', page.tags ? page.tags.map(t => t.tag).join(', ') : '']
['tags', page.tags ? page.tags.map(t => t.tag).join(', ') : ''],
['editor', page.editorKey]
]
switch (page.contentType) {
case 'markdown':
return '---\n' + meta.map(mt => `${mt[0]}: ${mt[1]}`).join('\n') + '\n---\n\n' + page.content
case 'html':
return '<!--\n' + meta.map(mt => `${mt[0]}: ${mt[1]}`).join('\n') + '\n-->\n\n' + page.content
case 'json':
return {
...page.content,
_meta: _.fromPairs(meta)
}
default:
return page.content
}