Update generate-index.mjs
This commit is contained in:
committed by
GitHub
parent
1c654a1cc7
commit
26cd19d6a6
@@ -97,7 +97,7 @@ async function collectFiles(relBase = "", flat = []) {
|
|||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const flat = await collectFiles();
|
const flat = await collectFiles();
|
||||||
// Only include sections with non-index files
|
// Sections = dirs with non-index files
|
||||||
const sections = [...new Set(flat.filter(f => !f.isIndex).map(f => f.path.split("/")[0]))].sort();
|
const sections = [...new Set(flat.filter(f => !f.isIndex).map(f => f.path.split("/")[0]))].sort();
|
||||||
const allTags = [...new Set(flat.flatMap(f => f.tags))].sort();
|
const allTags = [...new Set(flat.flatMap(f => f.tags))].sort();
|
||||||
await fs.writeFile(OUT, JSON.stringify({ flat, sections, tags: allTags }, null, 2));
|
await fs.writeFile(OUT, JSON.stringify({ flat, sections, tags: allTags }, null, 2));
|
||||||
|
|||||||
Reference in New Issue
Block a user