AstroReact企业官网

astro-quiet-paper — Astro 企业官网模板

作者 lifanh

基于 Astro 的散文优先个人站点模板,含 Markdown 写作、RSS 与 sitemap,以及一个未在导航中链接的 React 演示页。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

3 个预览视图
桌面端首页1 / 3
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 3

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-03查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

Astro 静态输出,文章由 content collections 与 Markdown 驱动

02

首页自动列出最新三篇非草稿文章,并提供 /writing 列表与详情路由

03

内置 RSS、robots.txt 与 sitemap,便于订阅和爬虫发现

04

通过 @astrojs/react 接入 React 岛,/demo 路由展示设计系统组件但不进入导航

05

mermaid 代码块在构建时转为内联 SVG,缓存文件需提交到仓库

06

样式基于 Tailwind 与 @lifanh/quiet-paper 的 token 和组件

模板详细介绍

这是一个以文字内容为主的静态站点模板,适合个人写作或轻量企业介绍页面。页面由 Astro 生成静态 HTML,文章使用 Astro content collections 与 Markdown 管理,首页自动展示最新三篇非草稿文章。站点内置 /writing 列表页与文章详情页,并输出 RSS、robots.txt 和 sitemap,便于搜索引擎与订阅工具发现内容。

模板包含一个 React 岛演示路由 /demo,用于展示 @lifanh/quiet-paper 设计系统组件,但该路由刻意不从站点导航中链接。样式通过 Tailwind CSS 与设计系统提供的 token 接入,组件(如 Panel、Button、Prose)从外部 npm 包导入,基础组件本身不在本仓库内维护。

Markdown 中的 mermaid 代码块在构建时渲染为内联 SVG,生成结果缓存在 src/generated/mermaid/ 并需提交到仓库,以便在 Cloudflare Workers Builds 等无浏览器环境中完成构建。若新增图表而没有对应缓存文件,构建会失败并给出提示,而不是静默省略图表。

使用前需要替换 src/site.ts 与 astro.config.mjs 中的站点名称和公开 URL,否则 RSS、sitemap 与 canonical 链接仍指向模板默认值。仓库采用 MIT 许可,但演示图片、字体、图标等第三方素材需单独核对许可。

AstroReact企业官网

适合你的项目吗?

适用场景

  • 个人博客或写作站点,需要 Markdown 写作与 RSS 订阅
  • 轻量企业或产品介绍页,以文字内容为主、页面结构简单
  • 需要在静态站点中嵌入少量 React 交互组件的项目
  • 文档或笔记类站点,需要在正文中插入 mermaid 图表

适合人群

  • 熟悉 Astro 与 Markdown 的个人开发者或小型团队
  • 希望以静态托管方式发布内容、不依赖服务端渲染的项目
  • 接受将设计系统作为外部 npm 依赖引入的站点
  • 需要 RSS 与 sitemap 等基础内容发现能力的站点

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    克隆仓库后执行 npm install 与 npm run dev,本地开发服务默认在 4321 端口

  2. 2

    部署前修改 src/site.ts 与 astro.config.mjs 中的站点名称和公开 URL

  3. 3

    新增或修改 mermaid 图表后需本地构建并提交 src/generated/mermaid/ 下的 SVG 缓存,否则 CI 构建会失败

  4. 4

    本地渲染新图表若缺少浏览器,可执行 npx puppeteer browsers install chrome-headless-shell 后重新构建

  5. 5

    更换 mermaid 渲染器或主题后,运行 npm run build 刷新缓存,并用 npx astro build --force 避免复用旧内容缓存

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 模板包含 /demo 演示路由,但该路由刻意未从站点导航中链接,仅作为开发演示使用。
  • 基础组件(Button、Field、ErrorState 等)不在本仓库内维护,而是来自外部设计系统仓库与 npm 包 @lifanh/quiet-paper,使用该模板需依赖此外部包。
  • 使用 mermaid 图表时,必须将 src/generated/mermaid/ 下的 SVG 缓存文件提交到仓库,否则 CI/Workers Builds 构建会失败。
  • 若新增 mermaid 代码块而没有对应的已提交 SVG 缓存,构建会直接失败并给出提示,不会静默省略图表。
  • 本地渲染新 mermaid 图表时若缺少浏览器,需额外安装 chrome-headless-shell 才能完成构建。
  • 部署前必须替换 src/site.ts 与 astro.config.mjs 中的模板标识与公开 URL,否则 RSS、sitemap 与 canonical 链接仍指向模板默认值。
  • 采用 MIT 许可,可自由使用与修改,但需保留版权与许可声明,并建议将站点标识中的 “Lifan” 替换为自己的名称。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

The developer demo route stays at `/demo`, but it is intentionally not linked from the site chrome.

README 原文

Primitives (`Button`, `Field`, `ErrorState`, …) live in the **design system repo**, not here.

README 原文

commit those files so Cloudflare Workers Builds can render the site without launching Chromium on every deploy

README 原文

If Cloudflare Workers Builds sees a new Mermaid block without a cached SVG, the build fails with instructions instead of silently omitting the diagram.

README 原文

run `npx puppeteer browsers install chrome-headless-shell`, then run `npm run build` again

README 原文

Before deploying, replace the template identity and URL in `src/site.ts` and `astro.config.mjs`.

README 原文

MIT — fork and replace “Lifan” with your name in `src/site.ts`.

README 原文
https://github.com/lifanh/astro-quiet-paper/blob/main/LICENSEhttps://github.com/lifanh/astro-quiet-paper/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-03。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 85 / 100
技术栈
Astro · React
网站类型
企业官网
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-10-01
截图检查日期
2026-10-03

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Astro。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。

查看当时使用的来源资料

SHA-256: e091cbac9e2eaa98f7558cceb7f31ef7bae3ec272621ef538a2ee5d8eaca6829

2026-10-03T05:58:05.225Z

来源文件 / 仓库
# astro-quiet-paper

[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/lifanh/astro-quiet-paper)

**Live preview:** <https://astro-quiet-paper.lifanh.workers.dev/>

Astro **template** for a prose-first personal site: static pages, Markdown writing, and a hidden React island demo styled with [`@lifanh/quiet-paper`](https://www.npmjs.com/package/@lifanh/quiet-paper).

**Quiet paper:** warm off-white, ink-like type, hairline borders, one restrained accent — no dashboard chrome.

![Astro quiet-paper homepage preview](docs/preview.png)

## Stack

| Layer | Choice |
|--------|--------|
| Static | Astro 7 |
| Writing | Astro content collections + Markdown |
| Islands | React 19 + `@astrojs/react` |
| Styles | Tailwind CSS v4 + design system tokens |
| Discovery | RSS, sitemap, robots |

## Quick start

```bash
git clone [email protected]:lifanh/astro-quiet-paper.git my-site
cd my-site
npm install
npm run dev
```

Open `http://localhost:4321`.

Before deploying, replace the template identity and URL in `src/site.ts` and `astro.config.mjs`.

## Writing

Posts live in `src/content/posts/*.md`:

```md
---
title: "Designing with less"
description: "Short summary for lists and SEO."
date: 2026-07-05
tags: ["design", "systems"]
draft: false
---
```

Routes included:

- `/writing` — all non-draft posts
- `/writing/[...slug]` — individual posts
- `/rss.xml` — feed for non-draft posts
- `/robots.txt` and `/sitemap-index.xml` — crawler discovery

The homepage automatically shows the latest three non-draft posts.

Fenced `mermaid` code blocks are rendered to inline SVG at build time. The original Mermaid source remains available under each diagram’s “Mermaid source” disclosure. Generated SVGs are cached in `src/generated/mermaid/`; commit those files so Cloudflare Workers Builds can render the site without launching Chromium on every deploy. Locally, `npm run build` generates or repairs missing/invalid cache files before Astro starts. In CI/Workers Builds, it checks that every Mermaid fence under `src/` has a committed, complete SVG before Astro starts.

## Design system setup

Tokens and utilities come from the package (Tailwind v4 Pattern A). Already wired in `src/styles/global.css`:

```css
@import "tailwindcss";
@plugin "@tailwindcss/typography";
@import "@lifanh/quiet-paper/styles/tailwind-sources.css";
@import "@lifanh/quiet-paper/styles/tokens.css" layer(theme);
@import "@lifanh/quiet-paper/styles/tailwind-theme.css";
```

Components in React islands and rendered Markdown pages:

```tsx
import { Panel, Button, Prose } from "@lifanh/quiet-paper";
```

The developer demo route stays at `/demo`, but it is intentionally not linked from the site chrome.

## Customize

| File | What to change |
|------|----------------|
| `src/site.ts` | Site name, public URL, nav, default meta |
| `astro.config.mjs` | Astro `site` URL for sitemap/canonical output |
| `src/pages/index.astro` | Homepage copy (Work / Writing / Contact) |
| `src/content/pages/about.md` | About page copy |
| `src/content/posts/*.md` | Writing entries |
| `src/generated/mermaid/*.svg` | Build-time rendered Mermaid diagrams |
| `src/demo/*` | Demo composites — copy patterns, don’t fork primitives |

Primitives (`Button`, `Field`, `ErrorState`, …) live in the **design system repo**, not here.

## Project layout

```text
src/
├── components/                # site chrome (header, footer)
├── demo/                      # React islands for /demo only
├── content/pages/about.md     # Markdown-backed About page
├── content/posts/             # Markdown writing
├── content.config.ts          # page/post frontmatter schemas
├── layouts/BaseLayout.astro   # shell + global meta + CSS
├── lib/posts.ts               # writing helpers
├── lib/markdown/mermaid.js    # build-time Mermaid renderer/cache check
├── pages/                     # routes, RSS, robots
├── generated/mermaid/         # committed SVG cache for Mermaid fences
├── site.ts                    # nav + metadata
└── styles/global.css          # Tailwind + DS imports
```

## Commands

| Command | Action |
|---------|--------|
| `npm run dev` | Dev server `:4321` |
| `npm run lint` | Oxlint source checks |
| `npm run check` | Astro + TypeScript diagnostics |
| `npm run build` | Static `dist/` |
| `npm run mermaid:prune` | Remove stale generated Mermaid SVGs |
| `npm run preview` | Preview production build |

## Deploy

### Deploy to Cloudflare Workers (one click)

Use the **Deploy to Cloudflare** button above (or open the [deploy flow](https://deploy.workers.cloudflare.com/?url=https://github.com/lifanh/astro-quiet-paper)). Cloudflare will fork the repo into your GitHub account, connect **Workers Builds**, and deploy static assets from `dist/` using [`wrangler.jsonc`](wrangler.jsonc).

Suggested build settings (usually auto-detected):

| Setting | Value |
|---------|--------|
| Build command | `npm run build` |
| Deploy command | `npx wrangler deploy` |

If your site includes Mermaid diagrams, commit `src/generated/mermaid/*.svg` after a local build. If Cloudflare Workers Builds sees a new Mermaid block without a cached SVG, the build fails with instructions instead of silently omitting the diagram.

CI/Workers Builds skip Puppeteer’s browser download because they only validate committed SVGs. If a local build needs to render a new diagram and Puppeteer reports a missing browser, run `npx puppeteer browsers install chrome-headless-shell`, then run `npm run build` again. If you change the Mermaid renderer or theme, run `npm run build` to refresh SVG cache files, then run `npx astro build --force` once so Astro does not reuse old rendered Markdown from its content cache. After editing or removing diagrams, run `npm run mermaid:prune` to drop orphaned SVG cache files.

After the first deploy, set your public URL in `src/site.ts` and `astro.config.mjs` so RSS, sitemap, and canonical links are correct.

Local equivalent:

```bash
npm run deploy
```

### Other static hosts

Cloudflare Pages, Vercel, Netlify: build command `npm run build`, output directory `dist/`.

Set the same production URL in `src/site.ts` and `astro.config.mjs` before publishing.

## Related repos

- **Design system:** [quiet-paper](https://github.com/lifanh/quiet-paper) → npm `@lifanh/quiet-paper`
- **Learning notes (optional):** your own `my-minimalism` or design journal — not required to run this template

## License

MIT — fork and replace “Lifan” with your name in `src/site.ts`.
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。