From 5d7bd658d0a76845eb83ae521744be9e36cfdccd Mon Sep 17 00:00:00 2001 From: Elihuso Quigley Date: Wed, 2 Apr 2025 18:35:53 +0800 Subject: [PATCH] [+] departure list --- scripts/build.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/build.ts b/scripts/build.ts index 6e9f3472..6566850a 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -70,6 +70,7 @@ function buildPeopleInfoAndList() { const peopleList: PeopleMeta[] = []; const peopleHomeList: PeopleMeta[] = []; const birthdayList = [] as [string, string][] + const departureList = [] as [string, string][] // For each person for (const { dirname, srcPath, distPath } of people) { @@ -106,6 +107,12 @@ function buildPeopleInfoAndList() { } } + if (info.id && info.info && info.info.died) { + if (!actualHide.includes(info.id)) { + departureList.push([info.id, info.info.died]) + } + } + // Convert info dict to [[key, value], ...] // And add info k-v pairs from markdown to the info object in json5 info.info = [...Object.entries(mdMeta.info ?? {}), ...Object.entries(info.info ?? {})] @@ -156,6 +163,7 @@ function buildPeopleInfoAndList() { fs.writeFileSync(path.join(projectRoot, DIST_DIR, `people-list${lang}.json`), JSON.stringify(peopleList)); fs.writeFileSync(path.join(projectRoot, DIST_DIR, `people-home-list${lang}.json`), JSON.stringify(peopleHomeList)); fs.writeFileSync(path.join(projectRoot, DIST_DIR, 'birthday-list.json'), JSON.stringify(birthdayList)); + fs.writeFileSync(path.join(projectRoot, DIST_DIR, 'departure-list.json'), JSON.stringify(departureList)); } }