feat: delete user with replace target

This commit is contained in:
NGPixel
2020-05-30 16:34:09 -04:00
parent 006dae1221
commit 1f9e5b3fd0
15 changed files with 1703 additions and 749 deletions

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
}