mirror of
https://github.com/one-among-us/data.git
synced 2024-11-10 13:24:50 +08:00
[+] trigger list
This commit is contained in:
parent
7c50a77b98
commit
49950ca60c
@ -8,5 +8,8 @@
|
|||||||
],
|
],
|
||||||
"actualHide": [
|
"actualHide": [
|
||||||
"__shi_Yumiaoya__"
|
"__shi_Yumiaoya__"
|
||||||
|
],
|
||||||
|
"trigger": [
|
||||||
|
"__shi_Yumiaoya__"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import metadataParser from 'markdown-yaml-metadata-parser';
|
|||||||
import { renderMdx } from "./mdx.js";
|
import { renderMdx } from "./mdx.js";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { handleFeatures } from "./feature.js";
|
import { handleFeatures } from "./feature.js";
|
||||||
|
import { HData, PeopleMeta } from "./data.js";
|
||||||
|
|
||||||
const PUBLIC_DIR = "public";
|
const PUBLIC_DIR = "public";
|
||||||
|
|
||||||
@ -27,26 +28,12 @@ const people = fs.readdirSync(peopleDir).map(person => ({
|
|||||||
distPath: path.join(projectRoot, DIST_DIR, PEOPLE_DIR, person)
|
distPath: path.join(projectRoot, DIST_DIR, PEOPLE_DIR, person)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
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 hdata = JSON.parse(fs.readFileSync(path.join(projectRoot, DATA_DIR, "hdata.json")).toString()) as HData;
|
||||||
const commentOnlyList = hdata.commentOnly;
|
const commentOnlyList = hdata.commentOnly;
|
||||||
const excludeList = commentOnlyList.concat(hdata.exclude);
|
const excludeList = commentOnlyList.concat(hdata.exclude);
|
||||||
const notShowOnHomeList = hdata.notShowOnHome;
|
const notShowOnHomeList = hdata.notShowOnHome;
|
||||||
const actualHide = hdata.actualHide;
|
const actualHide = hdata.actualHide;
|
||||||
|
const trigger = hdata.trigger;
|
||||||
interface PeopleMeta {
|
|
||||||
id: string
|
|
||||||
name: string
|
|
||||||
profileUrl: string
|
|
||||||
path: string
|
|
||||||
sortKey: string
|
|
||||||
}
|
|
||||||
|
|
||||||
// Transform `info.json5` to `info.json`.
|
// Transform `info.json5` to `info.json`.
|
||||||
// Extract metadata from `people/${dirname}/info.json5` to `dist/people-list.json`.
|
// Extract metadata from `people/${dirname}/info.json5` to `dist/people-list.json`.
|
||||||
@ -184,6 +171,7 @@ function copyPeopleAssets() {
|
|||||||
// Copy files `public` to dist.
|
// Copy files `public` to dist.
|
||||||
function copyPublic() {
|
function copyPublic() {
|
||||||
fs.copySync(path.join(projectRoot, PUBLIC_DIR), path.join(projectRoot, DIST_DIR));
|
fs.copySync(path.join(projectRoot, PUBLIC_DIR), path.join(projectRoot, DIST_DIR));
|
||||||
|
fs.writeFileSync(path.join(DIST_DIR, 'trigger-list.json'), JSON.stringify(trigger as string[]));
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyComments() {
|
function copyComments() {
|
||||||
|
@ -1,6 +1,22 @@
|
|||||||
export interface BannerData {
|
export interface HData {
|
||||||
type: string,
|
commentOnly: string[];
|
||||||
icon: string,
|
exclude: string[];
|
||||||
title: string,
|
notShowOnHome: string[];
|
||||||
text: string
|
actualHide: string[];
|
||||||
|
trigger: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PeopleMeta {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
profileUrl: string;
|
||||||
|
path: string;
|
||||||
|
sortKey: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BannerData {
|
||||||
|
type: string;
|
||||||
|
icon: string;
|
||||||
|
title: string;
|
||||||
|
text: string;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user