front-matter
front-matter copied to clipboard
FEATURE REQUEST rebundle modified front-matter object into markdown
i was trying modify date from attribute.
console.log(`File: ${file}, Creation Date: ${creationDate}`);
const read = fs.readFileSync(path.join(process.cwd(), file), {
encoding: "utf-8",
});
try {
const parse = fm(read);
parse.attributes.date = creationDate;
console.log(parse);
} catch (error) {
console.error(`fail parse ${file}`);
}
the main problem is, how to rebundle into markdown front-matter format ?
---
title: xxxx
any other attributes
---
body string
add the function please