Update generate-index.mjs
This commit is contained in:
parent
5201416d75
commit
391c939f10
1 changed files with 1 additions and 1 deletions
|
|
@ -77,7 +77,6 @@ async function collectFiles(relBase = "", flat = []) {
|
||||||
|
|
||||||
const ctime = st.birthtimeMs || st.mtimeMs || dateFromName(e.name) || st.mtimeMs;
|
const ctime = st.birthtimeMs || st.mtimeMs || dateFromName(e.name) || st.mtimeMs;
|
||||||
const mtime = dateFromName(e.name) ?? st.mtimeMs;
|
const mtime = dateFromName(e.name) ?? st.mtimeMs;
|
||||||
|
|
||||||
const baseName = e.name.toLowerCase();
|
const baseName = e.name.toLowerCase();
|
||||||
|
|
||||||
flat.push({
|
flat.push({
|
||||||
|
|
@ -100,6 +99,7 @@ async function collectFiles(relBase = "", flat = []) {
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const flat = await collectFiles();
|
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 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));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue