This commit is contained in:
eric
2026-06-08 06:05:31 -05:00
parent ebfec37e47
commit 06ab949d81
77 changed files with 3646 additions and 358 deletions

137
config/debug-features.ts Normal file
View File

@@ -0,0 +1,137 @@
/**
* 开发调试:可切换的隐藏功能注册表
* 默认值与 nav.config / home.config 中的 hidden 开关保持一致
*/
import { HOME_MEDIA_PRESS_ENABLED, HOME_RIGHT_FEATURE_CARDS_ENABLED } from "./home.config";
import type { NavLink } from "./nav.config";
export interface DebugFeature {
id: string;
label: string;
description: string;
category: string;
defaultVisible: boolean;
navLabelKey?: NavLink["labelKey"];
}
export const DEBUG_FEATURES: DebugFeature[] = [
{
id: "nav.cities",
label: "城市",
description: "顶部导航 🏙️ → /",
category: "顶部导航",
defaultVisible: false,
navLabelKey: "cities",
},
{
id: "nav.guide",
label: "游民指南",
description: "顶部导航 🧭 → /digital",
category: "顶部导航",
defaultVisible: false,
navLabelKey: "guide",
},
{
id: "nav.dashboard",
label: "下一站",
description: "顶部导航 📍 → /dashboard",
category: "顶部导航",
defaultVisible: false,
navLabelKey: "dashboard",
},
{
id: "nav.travel",
label: "聚会",
description: "顶部导航 ✈️ → /meetups",
category: "顶部导航",
defaultVisible: false,
navLabelKey: "travel",
},
{
id: "nav.community",
label: "社区",
description: "顶部导航 💬 → /dating",
category: "顶部导航",
defaultVisible: false,
navLabelKey: "community",
},
{
id: "nav.tools",
label: "工具箱",
description: "顶部导航 📊 → /tools",
category: "顶部导航",
defaultVisible: false,
navLabelKey: "tools",
},
{
id: "nav.ai",
label: "AI",
description: "顶部导航 🤖 → /ai",
category: "顶部导航",
defaultVisible: false,
navLabelKey: "ai",
},
{
id: "nav.gigs",
label: "赏金",
description: "顶部导航 💰 → /gigs",
category: "顶部导航",
defaultVisible: false,
navLabelKey: "gigs",
},
{
id: "nav.pricing",
label: "会员",
description: "顶部导航 👑 → /pricing",
category: "顶部导航",
defaultVisible: false,
navLabelKey: "pricing",
},
{
id: "nav.explore",
label: "探索",
description: "顶部导航 🎒 → /#community",
category: "顶部导航",
defaultVisible: false,
navLabelKey: "explore",
},
{
id: "nav.menu",
label: "更多",
description: "顶部导航网格按钮 · 点击头像亦可打开",
category: "顶部导航",
defaultVisible: false,
},
{
id: "home.rightFeatureCards",
label: "电子书 & 访谈视频",
description: "首页右侧网格顶部的两张内容卡片",
category: "首页",
defaultVisible: HOME_RIGHT_FEATURE_CARDS_ENABLED,
},
{
id: "home.mediaPress",
label: "媒体报道",
description: "首页 Hero 区底部的媒体名称列表",
category: "首页",
defaultVisible: HOME_MEDIA_PRESS_ENABLED,
},
];
export function getDebugFeatureById(id: string): DebugFeature | undefined {
return DEBUG_FEATURES.find((feature) => feature.id === id);
}
export function getDebugFeatureDefaultVisible(id: string): boolean {
return getDebugFeatureById(id)?.defaultVisible ?? false;
}
export function getNavLabelDebugFeatureId(
labelKey: NavLink["labelKey"]
): string | undefined {
return DEBUG_FEATURES.find((feature) => feature.navLabelKey === labelKey)?.id;
}
export function getDebugFeatureCategories(): string[] {
return [...new Set(DEBUG_FEATURES.map((feature) => feature.category))];
}

View File

@@ -143,7 +143,7 @@ export const ROUTES: Route[] = [
];
export const HOME_STATS: HomeStats = {
cities: "18",
cities: "46",
nomads: "5,000+",
meetups: "8+",
homeMeetups: "50+",
@@ -155,6 +155,12 @@ export const COMMUNITY_STATS = {
messagesPerMonth: "3,200+",
};
/** 首页右侧「电子书」「访谈视频」卡片;暂时关闭,改回 true 即可恢复 */
export const HOME_RIGHT_FEATURE_CARDS_ENABLED = false;
/** 首页 Hero 区「媒体报道」模块;暂时关闭,改回 true 即可恢复 */
export const HOME_MEDIA_PRESS_ENABLED = false;
export const HOME_CONFIG = {
memberPhotos: MEMBER_PHOTOS,
travelingNow: TRAVELING_NOW,

View File

@@ -1,6 +1,14 @@
export { SITE_CONFIG, getSiteConfig } from "./site.config";
export { getNavLinks, type NavLink } from "./nav.config";
export { getHomeConfig, HOME_CONFIG, MEMBER_PHOTOS, TRAVELING_NOW, MEETUPS, HOT_TOPICS, ROUTES, HOME_STATS, COMMUNITY_STATS, type MemberPhoto, type TravelingNow, type Meetup, type HotTopic, type Route, type HomeStats } from "./home.config";
export { getNavLinks, getAllNavLinks, type NavLink } from "./nav.config";
export {
DEBUG_FEATURES,
getDebugFeatureById,
getDebugFeatureDefaultVisible,
getNavLabelDebugFeatureId,
getDebugFeatureCategories,
type DebugFeature,
} from "./debug-features";
export { getHomeConfig, HOME_CONFIG, HOME_RIGHT_FEATURE_CARDS_ENABLED, MEMBER_PHOTOS, TRAVELING_NOW, MEETUPS, HOT_TOPICS, ROUTES, HOME_STATS, COMMUNITY_STATS, type MemberPhoto, type TravelingNow, type Meetup, type HotTopic, type Route, type HomeStats } from "./home.config";
export { FILTER_OPTIONS, FILTER_LABELS, type FilterOption } from "./filter.config";
export { FOOTER_SECTIONS, getFooterSections, type FooterLink, type FooterSection } from "./footer.config";
export {

View File

@@ -6,21 +6,27 @@ export interface NavLink {
labelKey: "cities" | "guide" | "dashboard" | "travel" | "community" | "tools" | "ai" | "gigs" | "pricing" | "explore";
icon: string;
href: string;
/** 顶部导航暂时隐藏;改回 false 或删除即可恢复 */
hidden?: boolean;
}
export const NAV_LINKS: NavLink[] = [
{ labelKey: "cities", icon: "🏙️", href: "/" },
{ labelKey: "guide", icon: "🧭", href: "/digital" },
{ labelKey: "dashboard", icon: "📍", href: "/dashboard" },
{ labelKey: "travel", icon: "✈️", href: "/meetups" },
{ labelKey: "community", icon: "💬", href: "/dating" },
{ labelKey: "tools", icon: "📊", href: "/tools" },
{ labelKey: "ai", icon: "🤖", href: "/ai" },
{ labelKey: "gigs", icon: "💰", href: "/gigs" },
{ labelKey: "pricing", icon: "👑", href: "/pricing" },
{ labelKey: "explore", icon: "🎒", href: "/#community" },
{ labelKey: "cities", icon: "🏙️", href: "/", hidden: true },
{ labelKey: "guide", icon: "🧭", href: "/digital", hidden: true },
{ labelKey: "dashboard", icon: "📍", href: "/dashboard", hidden: true },
{ labelKey: "travel", icon: "✈️", href: "/meetups", hidden: true },
{ labelKey: "community", icon: "💬", href: "/dating", hidden: true },
{ labelKey: "tools", icon: "📊", href: "/tools", hidden: true },
{ labelKey: "ai", icon: "🤖", href: "/ai", hidden: true },
{ labelKey: "gigs", icon: "💰", href: "/gigs", hidden: true },
{ labelKey: "pricing", icon: "👑", href: "/pricing", hidden: true },
{ labelKey: "explore", icon: "🎒", href: "/#community", hidden: true },
];
export function getNavLinks() {
return NAV_LINKS.filter((link) => !link.hidden);
}
export function getAllNavLinks() {
return NAV_LINKS;
}