同一套 Astro 项目同时承载博客、文档、更新日志与作品集案例
Cooper — Astro 作品集模板
作者 GladTek
Cooper 是 GladTek 开源的 Astro 模板,用同一套代码支撑博客、文档、更新日志与作品集案例,内置 Tailwind CSS 与 React 组件层,并带 i18n 与测试配置。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
组件按 UI、Sections、Layout、Blog、Common 分层,便于替换与复用
MDX 文档引擎带按文件夹自动分组的侧边栏、锚点链接与粘性页头对齐
类型安全的 i18n 字典,支持 RTL 镜像布局并在切换语言时保留当前路径
预置 Playwright 端到端测试与 Vitest 单元/组件测试
提供 Cloudflare、Vercel、Netlify 与 Node.js 的构建命令和部署入口
模板详细介绍
Cooper 是一个面向内容型站点的 Astro 模板,把博客、文档、更新日志和作品集案例放在同一套项目结构里。仓库按 UI、Sections、Layout、Blog、Common 分层组织组件,页面结构、SEO 组件、面包屑、主题切换、语言选择与 Cookie 同意等常见模块已经拆好,便于按需替换内容。
文档部分基于 MDX,侧边栏按文件夹自动分组,并提供锚点链接与粘性页头对齐;多语言通过类型安全的 .ts 与 .properties 字典管理,支持 RTL 布局镜像,切换语言时保留当前页面路径。
测试方面预置 Playwright 端到端测试与 Vitest 单元/组件测试,覆盖表单提交、搜索索引、语言切换与响应式布局等流程。部署提供 Cloudflare、Vercel、Netlify 与 Node.js 的构建命令,并附带对应平台的一键部署入口。
需要注意的是,仓库中的演示图片、字体、图标等第三方素材需单独核对其许可;域名、托管等外部服务可能产生额外费用。模板以 MIT 许可发布,使用与分发时需保留版权与许可声明。
适合你的项目吗?
适用场景
- 搭建同时包含博客与产品文档的内容站点
- 为开源项目或产品维护更新日志与作品集案例页
- 需要多语言(含 RTL 语言)支持的营销或文档站点
- 希望以现成分层组件和测试配置作为起点的 Astro 项目
适合人群
- 使用 Astro 并需要内容、文档与案例混合结构的开发者
- 需要 i18n 与 RTL 支持的团队
- 希望项目自带端到端与单元测试配置的团队
- 计划部署到 Cloudflare、Vercel、Netlify 或 Node.js 的项目
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
手动安装依赖需要 pnpm 10 或更高版本
- 2
复制 .env.example 为 .env 后再启动开发服务器
- 3
可使用 npx @gladtek/launch-cooper@latest 初始化新项目
- 4
按目标平台选择构建命令:build:cloudflare、build:vercel、build:netlify 或默认 build
- 5
演示图片、字体、图标等第三方素材需单独核对许可,域名与托管等外部服务可能另外收费
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
- 手动安装依赖要求使用 pnpm 10 或更高版本,低于该版本的包管理器无法按文档完成安装。
- 启动前必须复制 .env.example 为 .env 并配置环境变量,否则开发服务器无法按预期运行。
- 部署到 Cloudflare 需使用专门的 build:cloudflare 构建命令,直接使用默认构建可能不适用于该平台。
- 部署到 Vercel 需改用 build:vercel 构建命令,不能沿用默认构建流程。
- 部署到 Netlify 需改用 build:netlify 构建命令,不能沿用默认构建流程。
- 快速初始化依赖 npm 上发布的 @gladtek/launch-cooper 脚手架包,需联网从 npm 拉取。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
1. **Install dependencies** (Requires **pnpm 10+**)
README 原文
2. **Configure Environment** ```bash cp .env.example .env ```
README 原文
- **Cloudflare**: `pnpm run build:cloudflare` (Recommended)
README 原文
- **Vercel**: `pnpm run build:vercel`
README 原文
- **Netlify**: `pnpm run build:netlify`
README 原文
https://github.com/GladTek/Cooper/blob/main/LICENSEhttps://github.com/GladTek/Cooper/blob/main/README.mdnpx @gladtek/launch-cooper@latest
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-05。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- Astro Themes
- 资料与维护参考分
- 资料较完整 · 92 / 100
- 技术栈
- Astro · React
- 网站类型
- 作品集 · 博客 · 文档 · 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-09-22
- 截图检查日期
- 2026-10-05
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Astro。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: [email protected] · 2026-10-05
查看当时使用的来源资料
SHA-256: a1de1cb8c3a6c637113ab9834c59d49b880b18631d047ebdd4faf0b9e3c4b31b
2026-10-05T00:45:48.263Z
来源文件 / 仓库# Cooper - The Ultimate Astro Boilerplate The advanced, batteries-included template for building blazing-fast modern web applications with **Astro 7**, **Tailwind CSS 4.2**, and **React 19**. <p align="center"> <img src="https://img.shields.io/github/v/release/gladtek/cooper?color=%231A81FA&label=Latest&logo=%20" alt="Latest Release" /> </p> | Cloudflare | Netlify | Vercel | | :--- | :--- | :--- | | [](https://deploy.workers.cloudflare.com/?url=https://github.com/GladTek/Cooper) | [](https://app.netlify.com/start/deploy?repository=https://github.com/GladTek/Cooper) | [](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FGladTek%2FCooper) | ## Live Demos | Platform | URL | | :--------- | :--------------------------------------- | | **Cloudflare** | [https://cooper.gladtek.com/](https://cooper.gladtek.com/) | | **Netlify** | [https://astro-cooper.netlify.app/](https://astro-cooper.netlify.app/) | | **Vercel** | [https://astro-cooper.vercel.app/](https://astro-cooper.vercel.app/) | ## Core Architectural Strategies This boilerplate is built on several key architectural pillars designed for scale, performance, and developer experience. ### 1. Atomic Component Strategy We categorize components into functional layers to ensure a clear separation of concerns: - **UI (Atoms)**: Fundamental building blocks like `Button`, `Badge`, `Heading`, and `Card`. - **Sections (Molecules/Organisms)**: Composed marketing sections like `Hero`, `FeaturesList`, `CTA`, and `PricingTable`. - **Layout (Structure)**: Page-level structure including `Header`, `Footer`, `SEO`, and `Breadcrumbs`. - **Blog (Contextual)**: Content-specific elements like `BlogCard`, `ChangelogItem`, and `TableOfContents`. - **Common (Utilities)**: System-level utilities like `ThemeToggle`, `LanguagePicker`, and `CookieConsent`. ### 2. Documentation-First Approach The project features a high-performance documentation engine powered by **MDX** and **Fuse.js**: - **Categorized Sidebar**: Documentation is automatically grouped by folder (e.g., `ui`, `sections`, `layout`). - **Premium Typography**: Custom-styled prose optimized for readability. - **Deep Linking**: Automatic anchor links and perfect scroll alignment with a sticky header. ### 3. Type-Safe Internationalization (i18n) - **Flat File Dictionary**: Localizations are managed via type-safe `.ts` and `.properties` files. - **RTL Support**: Automatic layout mirroring for languages like Arabic (`/ar/`). - **Path Persistence**: Switching languages preserves the current page path. ### 4. Robust Testing Suite The boilerplate includes a pre-configured, production-ready testing infrastructure: - **E2E Testing (Playwright)**: Automated flows for Form Submissions, Search Indexing, Language Switching, and Responsiveness. - **Unit/Component Testing (Vitest)**: Fast, reliable testing for core logic and React islands using JSDOM. --- ## Features ### Core Stack - **Astro 7**: The latest version of the web framework for content-driven websites. - **Tailwind CSS 4.2**: Engine-integrated utility-first CSS using modern CSS variables. - **React 19**: Powered by React 19 for modern concurrent rendering and optimized hydration. - **TypeScript 6.0**: 100% type-safe codebase. ### Accessibility & Performance - **WCAG AA/AAA Compliant**: Accessible color contrast and focus state management. - **SSR/Hydration Optimized**: Production-grade Vite configuration resolving common hydration conflicts. - **Core Web Vitals**: Precision optimization for LCP and CLS out of the box. --- ## Getting Started ### Quick Start Initialize a new project instantly: ```bash npx @gladtek/launch-cooper@latest ``` ### Manual Setup 1. **Install dependencies** (Requires **pnpm 10+**) ```bash pnpm install ``` 2. **Configure Environment** ```bash cp .env.example .env ``` 3. **Start the dev server** ```bash pnpm run dev ``` --- ## Testing Cooper comes with a comprehensive testing suite to ensure stability across deployments. ### End-to-End (E2E) We use **Playwright** for full browser testing of critical user journeys. ```bash pnpm run test:e2e # Run all E2E tests pnpm run test:e2e:ui # Open Playwright UI for debugging ``` The suite covers: - **Contact Flows**: Form validation and submission states. - **I18n**: Correct language rendering and RTL switching. - **Search**: Real-time indexing and navigation results. - **Responsive**: Mobile menu functionality and layout adjustments. ### Unit & Component We use **Vitest** for fast testing of isolated logic and components. ```bash pnpm run test:unit # Run all unit tests pnpm run test:unit:watch # Watch mode ``` --- ## Performance Benchmarks 🚀 Cooper is engineered for speed and accessibility. We enforce these standards via **Lighthouse CI** as a mandatory quality gate for every build: | Category | Minimum Score | Severity | | :--- | :---: | :--- | | ⚡ **Performance** | **90** | `Warn` | | ♿ **Accessibility** | **95** | `Error` | | 🛡️ **Best Practices** | **90** | `Error` | | 🔍 **SEO** | **95** | `Error` | *Automated audits are performed on the **Homepage** and **Key Blog Content** for every PR to ensure zero performance regression.* --- ## Deployment The project supports multi-adapter deployment out of the box. Use the corresponding build command: - **Cloudflare**: `pnpm run build:cloudflare` (Recommended) - **Vercel**: `pnpm run build:vercel` - **Netlify**: `pnpm run build:netlify` - **Node.js**: `pnpm run build` (Default) --- **Built by Gladtek with ❤️ and the help of AI agents**
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

astrowind
⭕️ AstroWind: A free template using Astro v7 and Tailwind CSS v4. Astro starter theme.
Astro · 博客

astro-paper
A minimal, accessible and SEO-friendly Astro blog theme.
Astro · 博客

fuwari
✨A static blog template built with Astro.
Astro · 博客

Firefly
Firefly 是一款基于 Astro 的静态博客主题,由 CuteLeaf 在 saicaca 的 Fuwari 模板基础上二次开发,主打清新美观的视觉风格。
Astro · 博客

astro-theme-cactus
A simple Astro theme. Use it to create your blog or website.
Astro · 作品集

astrofy
Astrofy is a free and open-source template for your Personal Portfolio Website built with Astro and TailwindCS…
Astro · 作品集
