Skip to content

706青年空间门户网站(706web)

基于 VitePress 的静态门户网站,用于组织与展示 706 青年空间的内容与项目。

📋 目录

项目简介

  • 站点框架采用 VitePress,内容以 Markdown 为主,支持在页面中使用 Vue 组件。
  • 主题定制位于 .vitepress/theme,包含样式与组件扩展。
  • 静态资源置于 public/assets 目录,构建产物输出到 .vitepress/dist

技术栈

  • 框架:VitePress ^1.6.3(基于 Vue ^3.5.17
  • 构建:Vite ^7.0.0
  • 语言:TypeScript ^5.8.3
  • 样式:Tailwind CSS ^4.1.11
  • CSS 处理:PostCSS ^8.5.6 + Autoprefixer ^10.4.21
  • 运行时:Bun(推荐)或 Node.js 18+

快速开始

  1. 安装运行时与依赖

    bash
    # 推荐使用 Bun
    curl -fsSL https://bun.sh/install | bash
    bun --version
    
    # 安装依赖
    bun install
    # 或使用 npm
    npm install
  2. 启动开发

    bash
    bun run dev
    # 或
    npm run dev
    • 本地地址:http://localhost:5173
  3. 构建与预览

    bash
    bun run build     # 产物输出到 .vitepress/dist
    bun run preview   # 预览地址 http://localhost:4173

项目结构

与当前仓库一致的主要目录结构如下:

706web/
├── .vitepress/
│   ├── config.ts
│   └── theme/
│       ├── components/
│       ├── index.ts
│       └── style.css
├── about/
│   └── index.md
├── city-nodes/
│   ├── index.md
│   └── nodes/
│       └── shanghai-1.1.md
├── donate/
│   ├── funds.md
│   └── index.md
├── faq/
│   └── index.md
├── governance/
│   ├── groups.md
│   ├── mechanism.md
│   └── meetings.md
├── join/
│   ├── business-cooperation.md
│   ├── how-to-build-node.md
│   ├── how-to-join.md
│   └── start-activity.md
├── media/
│   └── index.md
├── projects/
│   ├── city-living-room.md
│   ├── flow-living-room.md
│   ├── index.md
│   ├── living-lab.md
│   └── living-room-talks.md
├── public/
│   └── assets/
│       ├── logo.svg 等静态资源
├── toolkit/
│   └── index.md
├── index.md
├── index.ts
└── package.json

内容导航

站点导航在 .vitepress/config.ts 中定义,当前主要导航包括:

  • 首页 /
  • 城市节点 /city-nodes/
  • 社区项目 /projects/
  • 捐赠 /donate/
  • 关于 /about/
  • 外部链接:论坛 https://706.town/

如需调整导航或侧边栏,请编辑 themeConfig.nav(或开启并修改 sidebar)配置。

样式与构建

  • Tailwind v4 已通过 @tailwindcss/postcss 集成,样式入口为主题的 style.css
  • PostCSS 配置位于 postcss.config.js,构建工具链由 Vite 驱动。
  • 图片与图标请放置在 public/assets 并通过 /assets/... 路径引用。

常用命令

bash
# 开发
bun run dev          # 或 npm run dev

# 构建与预览
bun run build        # 或 npm run build
bun run preview      # 或 npm run preview

# 依赖
bun install          # 或 npm install

部署

  • 执行 bun run build 后,静态文件在 .vitepress/dist
  • 可部署到 GitHub Pages、Netlify、Vercel 或任意静态托管服务。
  • GitHub Pages 示例:将 .vitepress/dist 推送到 gh-pages 分支并开启 Pages。

贡献

  • 欢迎通过 Issue 提交问题或建议,或发起 Pull Request。
  • 建议遵循约定式提交前缀:feat, fix, docs, style, refactor 等。

问题反馈

  • 站点相关问题与需求,请在仓库的 Issues 中反馈。
  • 若涉及安全或紧急事项,请通过维护者提供的联系方式沟通。

致谢


最后更新:2025-10-14 维护者:706 产品与技术小组