diff --git a/README.md b/README.md index ca7d3e0f..ed3710e7 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Please read our [How-We-Work](https://github.com/one-among-us/how-we-work/blob/m * [web](https://github.com/one-among-us/web) - 网页前端源码 * [backend](https://github.com/one-among-us/backend) - 献花和编辑后端源码 -## 文件结构 +## File Structure * Directory `/people//`: Data for a specific person * `info.json5`: Profile information @@ -38,3 +38,35 @@ Please read our [How-We-Work](https://github.com/one-among-us/how-we-work/blob/m 这个脚本不会覆盖在已有的繁体文件上的更改,更新已经生成过繁体的简体文稿之后会自动合并,不过还是要手动检查一下哦。 --> + +## HData + +`/data/hdata.json` defined some data which used for entry properties. Here is some description of it: + +* `commentOnly`: `string[]`, the entries which include comments only, like `tdor` or `tdov` +* `exclude`: `string[]`, the directories which would not be handled +* `notShowOnHome`: `string[]`, if you don't want a entry show on the home, add it into this item +* `actualHide`: `string[]`, if you don't want a entry show on the home and won't be redirected by random buttons, add it into this item. + If you set a entry in this list, you have no need to set it into `notShowOnHome` again. + +### Example + +```json +{ + "commentOnly": [ + "tdor" + ], + "exclude": [ + "tdov" + ], + "notShowOnHome": [ + "Anilovr", + "noname3031" + ], + "actualHide": [ + "ArtsEpiphany" + ] +} +``` + +If you don’t understand how to modify it, please feel free to [Contact Us](https://one-among.us/about/). diff --git a/data/hdata.json b/data/hdata.json index fbdf6fe1..7cf795e4 100644 --- a/data/hdata.json +++ b/data/hdata.json @@ -5,5 +5,6 @@ "exclude": [], "notShowOnHome": [ "MeowBot233" - ] + ], + "actualHide": [] } \ No newline at end of file diff --git a/scripts/build.ts b/scripts/build.ts index a5cab8ee..6c5403e1 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -31,12 +31,14 @@ interface HData { commentOnly: string[] exclude: string[] notShowOnHome: string[] + actualHide: string[] } const hdata = JSON.parse(fs.readFileSync(path.join(projectRoot, DATA_DIR, "hdata.json")).toString()) as HData; const commentOnlyList = hdata.commentOnly; const excludeList = commentOnlyList.concat(hdata.exclude); const notShowOnHomeList = hdata.notShowOnHome; +const actualHide = hdata.actualHide; interface PeopleMeta { id: string @@ -120,9 +122,11 @@ function buildPeopleInfoAndList() { // Add meta to people list if (peopleList.filter(it => it.id == peopleMeta.id).length == 0) { - peopleList.push(peopleMeta); - if (!notShowOnHomeList.includes(peopleMeta.id)) - peopleHomeList.push(peopleMeta) + if (!actualHide.includes(peopleMeta.id)) { + peopleList.push(peopleMeta); + if (!notShowOnHomeList.includes(peopleMeta.id)) + peopleHomeList.push(peopleMeta) + } } }