Skip to content

Commit 5d7bd65

Browse files
committed
[+] departure list
1 parent 2cf1116 commit 5d7bd65

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/build.ts

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ function buildPeopleInfoAndList() {
7070
const peopleList: PeopleMeta[] = [];
7171
const peopleHomeList: PeopleMeta[] = [];
7272
const birthdayList = [] as [string, string][]
73+
const departureList = [] as [string, string][]
7374

7475
// For each person
7576
for (const { dirname, srcPath, distPath } of people) {
@@ -106,6 +107,12 @@ function buildPeopleInfoAndList() {
106107
}
107108
}
108109

110+
if (info.id && info.info && info.info.died) {
111+
if (!actualHide.includes(info.id)) {
112+
departureList.push([info.id, info.info.died])
113+
}
114+
}
115+
109116
// Convert info dict to [[key, value], ...]
110117
// And add info k-v pairs from markdown to the info object in json5
111118
info.info = [...Object.entries(mdMeta.info ?? {}), ...Object.entries(info.info ?? {})]
@@ -156,6 +163,7 @@ function buildPeopleInfoAndList() {
156163
fs.writeFileSync(path.join(projectRoot, DIST_DIR, `people-list${lang}.json`), JSON.stringify(peopleList));
157164
fs.writeFileSync(path.join(projectRoot, DIST_DIR, `people-home-list${lang}.json`), JSON.stringify(peopleHomeList));
158165
fs.writeFileSync(path.join(projectRoot, DIST_DIR, 'birthday-list.json'), JSON.stringify(birthdayList));
166+
fs.writeFileSync(path.join(projectRoot, DIST_DIR, 'departure-list.json'), JSON.stringify(departureList));
159167
}
160168
}
161169

0 commit comments

Comments
 (0)