fixup
This commit is contained in:
@@ -8,8 +8,8 @@ const nhm = new NodeHtmlMarkdown({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function toYaml(data, body) {
|
function toYaml(data, body) {
|
||||||
const frontmatter = Object.keys(data).sort().map(key => key+': '+(data[key] ?? '')).join("\n");
|
const frontmatter = Object.keys(data).sort().map(key => key+': '+(data[key] ? '"'+data[key]+'"' : '')).join("\n");
|
||||||
return frontmatter + "\n---\n" + nhm.translate(body);
|
return "---\n" + frontmatter + "\n---\n" + nhm.translate(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
function date(datestr) {
|
function date(datestr) {
|
||||||
@@ -26,7 +26,7 @@ data.forEach((node, ix) => {
|
|||||||
const lang = 'und';
|
const lang = 'und';
|
||||||
const filepath = path.join('out', node.type);
|
const filepath = path.join('out', node.type);
|
||||||
const body = node.body.und[0].value;
|
const body = node.body.und[0].value;
|
||||||
const filename = `${node.uuid}.yml`;
|
const filename = `${node.uuid}.md`;
|
||||||
|
|
||||||
fs.mkdirSync(path.join(__dirname, filepath), { recursive: true });
|
fs.mkdirSync(path.join(__dirname, filepath), { recursive: true });
|
||||||
const item = {
|
const item = {
|
||||||
|
|||||||
Reference in New Issue
Block a user