增加website

This commit is contained in:
2026-09-14 22:24:55 +08:00
parent bb8a6936e4
commit 7e6a3e969f
57 changed files with 10568 additions and 1 deletions
+123
View File
@@ -0,0 +1,123 @@
import type { Category, SectionKey } from "@/types/content";
export interface SectionConfig {
key: SectionKey;
title: string;
subtitle: string;
/** 列表页路径 */
basePath: string;
/** 详情页路径前缀 */
detailPath: string;
/** 分类页路径前缀 */
categoryPath: string;
/** 计数单位 */
unit: string;
/** 列表布局:list = 横向大卡;grid = 竖向卡片网格 */
layout: "list" | "grid";
/** 是否提供关键字搜索 */
searchable: boolean;
categories: Category[];
}
export const sections: Record<SectionKey, SectionConfig> = {
news: {
key: "news",
title: "新闻中心",
subtitle: "了解云泽科技的产品动态、公司公告与行业活动。",
basePath: "/news",
detailPath: "/news/detail",
categoryPath: "/news/category",
unit: "条",
layout: "list",
searchable: true,
categories: [
{ slug: "company", name: "公司公告", desc: "融资、认证、人事与经营相关的官方信息。" },
{ slug: "product", name: "产品发布", desc: "版本更新、新功能上线与产品路线说明。" },
{ slug: "event", name: "市场活动", desc: "大会、公开课、巡展等线上线下活动。" },
{ slug: "case", name: "客户案例", desc: "各行业客户的落地实践与项目成果。" },
],
},
products: {
key: "products",
title: "产品中心",
subtitle: "从云原生底座到数据智能应用,构建完整的产品矩阵。",
basePath: "/products",
detailPath: "/products/detail",
categoryPath: "/products/category",
unit: "款",
layout: "grid",
searchable: true,
categories: [
{ slug: "platform", name: "平台产品", desc: "支撑业务运行的底层技术平台。" },
{ slug: "data", name: "数据产品", desc: "数据采集、治理与分析类产品。" },
{ slug: "app", name: "应用产品", desc: "面向具体业务场景的智能应用。" },
],
},
solutions: {
key: "solutions",
title: "解决方案",
subtitle: "面向重点行业的场景化方案,从诊断到落地全程陪跑。",
basePath: "/solutions",
detailPath: "/solutions/detail",
categoryPath: "/solutions/category",
unit: "套",
layout: "grid",
searchable: true,
categories: [
{ slug: "manufacturing", name: "制造业", desc: "离散与流程制造的生产数字化。" },
{ slug: "retail", name: "零售消费", desc: "会员、商品与门店的数据运营。" },
{ slug: "energy", name: "能源电力", desc: "设备状态监测与预测性维护。" },
{ slug: "finance", name: "金融", desc: "数据合规、风控与实时报表。" },
],
},
cases: {
key: "cases",
title: "客户案例",
subtitle: "超过 1000 家企业客户,在这些场景里跑通了数字化。",
basePath: "/cases",
detailPath: "/cases/detail",
categoryPath: "/cases/category",
unit: "个",
layout: "grid",
searchable: true,
categories: [
{ slug: "manufacturing", name: "制造业", desc: "" },
{ slug: "retail", name: "零售消费", desc: "" },
{ slug: "energy", name: "能源电力", desc: "" },
{ slug: "finance", name: "金融", desc: "" },
],
},
events: {
key: "events",
title: "市场活动",
subtitle: "大会、公开课与合作巡展,全年活动一站查看。",
basePath: "/events",
detailPath: "/events/detail",
categoryPath: "/events/category",
unit: "场",
layout: "list",
searchable: false,
categories: [
{ slug: "conference", name: "行业大会", desc: "" },
{ slug: "online", name: "线上直播", desc: "" },
{ slug: "offline", name: "线下活动", desc: "" },
],
},
};
/** 从路由路径推断栏目:/news/detail/xxx -> news */
export function sectionFromPath(path: string): SectionConfig | undefined {
const first = path.split("/").filter(Boolean)[0];
return first && first in sections ? sections[first as SectionKey] : undefined;
}
/** 查询某个分类的展示名 */
export function categoryName(
section: SectionKey,
slug: string | undefined
): string {
if (!slug) return "全部";
return (
sections[section].categories.find((item) => item.slug === slug)?.name ?? "全部"
);
}