Update generate-index.mjs

This commit is contained in:
Mark Randall Havens △ The Empathic Technologist ⟁ Doctor Who 42 2025-11-08 19:26:48 -06:00 committed by GitHub
parent 5201416d75
commit 391c939f10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,7 +77,6 @@ async function collectFiles(relBase = "", flat = []) {
const ctime = st.birthtimeMs || st.mtimeMs || dateFromName(e.name) || st.mtimeMs;
const mtime = dateFromName(e.name) ?? st.mtimeMs;
const baseName = e.name.toLowerCase();
flat.push({
@ -100,6 +99,7 @@ async function collectFiles(relBase = "", flat = []) {
(async () => {
try {
const flat = await collectFiles();
// ONLY non-index files → dropdown
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();
await fs.writeFile(OUT, JSON.stringify({ flat, sections, tags: allTags }, null, 2));