💡 本项目全程使用 Vibecoding 完成,总计耗时 5 小时 20 分钟
演示网址: TDP 24 年度/ 25年度 颁奖: https://tdp-hornor.onmicrosoft.cn/
微信内打开: https://tdp-hornor.icodeq.com/
GitHub 开源: https://github.com/zkeq/tdp-hornor
TDP Honor 是一个专为腾讯云开发者先锋(Tencent Cloud Developer Pioneer)项目打造的获奖者展示网站。该网站采用现代化的设计风格,提供流畅的用户体验,展示历年获奖者的荣誉信息。
tdp-hornor/ ├── src/ │ ├── components/ # 可复用组件 │ │ ├── Background.astro # 背景效果组件 │ │ ├── Hero.astro # 首页英雄区域 │ │ ├── IntroCard.astro # 介绍卡片 │ │ ├── StatCard.astro # 统计卡片 │ │ ├── EditionCard.astro # 年份卡片 │ │ ├── CTAButton.astro # 行动号召按钮 │ │ ├── Footer.astro # 页脚 │ │ ├── AwardsPageHeader.astro # 获奖页面头部 │ │ ├── AwardCategoryCard.astro # 奖项分类卡片 │ │ ├── RecipientCard.astro # 获奖者卡片 │ │ ├── HonorBackButton.astro # 返回按钮 │ │ ├── HonorCertificateCard.astro # 证书卡片 │ │ ├── OfficialCertificateViewer.astro # 官方证书查看器 │ │ └── SharePrompt.astro # 分享提示 │ ├── layouts/ # 布局组件 │ │ └── BaseLayout.astro # 基础布局 │ ├── pages/ # 页面路由 │ │ ├── index.astro # 首页 │ │ ├── awards.astro # 年份选择页 │ │ ├── awards/ │ │ │ └── [year].astro # 动态年份获奖名单页 │ │ └── hornor/ │ │ └── [id].astro # 动态个人证书页 │ └── styles/ # 全局样式 │ └── global.css # 全局 CSS 和动画 ├── public/ # 静态资源 │ └── intro.txt # TDP 介绍文本 ├── astro.config.mjs # Astro 配置 ├── tailwind.config.js # Tailwind 配置 ├── tsconfig.json # TypeScript 配置 └── package.json # 项目依赖
# 克隆项目
git clone https://github.com/zkeq/tdp-hornor.git
cd tdp-hornor
# 安装依赖
npm install
# 启动开发服务器
npm run dev
访问 http://localhost:4321 查看网站。
# 构建生产版本
npm run build
# 预览构建结果
npm run preview
构建产物将生成在 dist/ 目录。
项目从以下 API 获取获奖者数据:
https://cnb.onmicrosoft.cn/tdp/tdp/-/git/raw/main/docs/honors/{year}.md
数据格式为 Markdown 文件中嵌入的 CSV:
nickname,award,grant_time,number 张三,年度贡献奖,2024-12-01,21000001 李四,技术创新奖,2024-12-01,21000002
在 src/pages/awards/[year].astro 和 src/pages/hornor/[id].astro 中修改 years 数组:
const years = ["2024", "2025"]; // 添加或修改年份
在相关页面中修改 apiUrl 变量:
const apiUrl = `https://your-api-domain.com/path/${year}.md`;
全局样式定义在 src/styles/global.css 中,包括:
项目构建后生成纯静态文件,可以部署到任何支持静态网站的平台:
欢迎贡献代码、报告问题或提出建议!
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。
如有问题或建议,欢迎通过以下方式联系:
Made with ❤️ by Zkeq
⭐ 如果这个项目对你有帮助,请给它一个星标!