(source, files, exportedAt)
| 47 | if (content) results.push({ name: entry.name, content }); |
| 48 | } |
| 49 | return results; |
| 50 | } |
| 51 | |
| 52 | function buildArchiveFile(source, files, exportedAt) { |
| 53 | if (!files.length) return null; |
| 54 | const frontmatter = `---\ncitadel-archive: true\nexported-at: ${exportedAt}\nsource: ${source}\n---`; |
| 55 | const body = files |
| 56 | .map(f => `## ${f.name.replace(/\.md$/, '')}\n\n${f.content}`) |
| 57 | .join('\n\n---\n\n'); |
| 58 | return `${frontmatter}\n\n${body}\n`; |
| 59 | } |