mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
Merge pull request #42 from stanlemon/date-categories-tags
Add time to post date, add categories & tags
This commit is contained in:
+4
-2
@@ -58,8 +58,10 @@ async function loadMarkdownFilePromise(post) {
|
||||
let output = '---\n';
|
||||
Object.entries(post.frontmatter).forEach(pair => {
|
||||
const key = pair[0];
|
||||
const value = (pair[1] || '').replace(/"/g, '\\"');
|
||||
output += key + ': "' + value + '"\n';
|
||||
const value = Array.isArray(pair[1])
|
||||
? (pair[1].length === 0 ? "" : "\n - \"" + pair[1].join("\"\n - \"") + "\"")
|
||||
: '"' + (pair[1] || '').replace(/"/g, '\\"') +'"';
|
||||
output += key + ': ' + value + '\n';
|
||||
});
|
||||
output += '---\n\n' + post.content + '\n';
|
||||
return output;
|
||||
|
||||
Reference in New Issue
Block a user