feat(export): simplify writeup export to pure human-like markdown layout without cards and exclude _index documents
CI / typecheck + tests (push) Canceled after 0s
CI / build + deploy (Nix) — api (push) Canceled after 0s
CI / build + deploy (Nix) — mcp (push) Canceled after 0s
CI / build + deploy (Nix) — worker (push) Canceled after 0s
CI / build + deploy (web) (push) Canceled after 0s

This commit is contained in:
asepharyana
2026-08-22 13:49:00 +07:00
parent 72b53afe06
commit 4f0d2da876
3 changed files with 111 additions and 300 deletions
+19 -1
View File
@@ -104,8 +104,26 @@ export async function getExportDocuments(
return { ...toMeta(row), body: body || "" };
});
// Filter out meta index documents (like _index or index) when exporting multiple docs
let filteredDocs = loadedDocs;
if (loadedDocs.length > 1) {
const withoutIndex = loadedDocs.filter((d) => {
const slug = d.slug.toLowerCase();
return (
!slug.endsWith("/_index") &&
!slug.endsWith("/index") &&
slug !== "_index" &&
slug !== "index" &&
d.type !== "writeup-index"
);
});
if (withoutIndex.length > 0) {
filteredDocs = withoutIndex;
}
}
// Sort neatly
const sortedDocs = sortExportDocuments(loadedDocs, sortBy);
const sortedDocs = sortExportDocuments(filteredDocs, sortBy);
const summary = buildExportSummary(sortedDocs, opts.path, opts.section);
return {