feat: Allow document metadata to be stored in zip comment

This commit is contained in:
Tom Moor
2020-12-27 12:36:06 -08:00
parent c8cd7fcf4a
commit 012e6b320e
4 changed files with 29 additions and 10 deletions

View File

@ -20,7 +20,14 @@ async function addToArchive(zip, documents) {
text = text.replace(attachment.redirectUrl, encodeURI(attachment.key));
}
zip.file(`${document.title || "Untitled"}.md`, text);
zip.file(`${document.title || "Untitled"}.md`, text, {
date: document.updatedAt,
comment: JSON.stringify({
pinned: document.pinned,
createdAt: document.createdAt,
updatedAt: document.updatedAt,
}),
});
if (doc.children && doc.children.length) {
const folder = zip.folder(document.title);