feat(website): 对齐官网文章配置与展示顺序

This commit is contained in:
zhanjunhao
2026-11-17 00:38:40 +08:00
parent 34a7eca5c7
commit d563fe7c76
9 changed files with 291 additions and 245 deletions
+2 -6
View File
@@ -168,15 +168,11 @@ export function validateField(key, rawValue) {
return '';
}
// An empty article list is valid: the official list page shows its "内容筹备中" empty state.
export function validateSettings(values) {
return Object.fromEntries(
[...new Set(TABS.flatMap((tab) => tab.fields))]
.map((key) => [
key,
key === 'insights' && !values.insights?.articles?.length
? '请完善动态与洞察的配置'
: validateField(key, values[key]),
])
.map((key) => [key, validateField(key, values[key])])
.filter(([, error]) => error),
);
}