Astro启动器

Refined-X — Astro 启动器模板

作者 tower1229

基于 Astro 与 Starlight 的个人发布启动器,同一份 Markdown/YAML 内容同时生成面向读者、搜索引擎与 AI 代理的多种输出。

看看你的网站会是什么样

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

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

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

全部页面与视图 3

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

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

值得关注的模板亮点

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

01

同一份 Markdown/YAML 语料生成人类可读网站、机器可读镜像与代理可查询接口三类输出

02

内容与主题解耦,contentRoot、publicDir、outDir 可配置,可对接模板外部的个人知识库

03

默认站点完全静态,/ask 无需模型、数据库或运行时费用即可检索精选问答与公开文章

04

可选 Public Ask Worker 提供 NLWeb 兼容 /ask 与 MCP ask 工具,附带配额、速率限制与来源链接

05

构建时校验文章 frontmatter 的日期、slug、摘要、问答字段与内容类型

06

内置明暗主题与编辑风格视觉系统,支持 giscus 文章评论(需 GitHub 账号参与)

模板详细介绍

Refined-X 是一个用 Astro 和 Starlight 构建的个人发布启动器,面向“一次发布,同时服务人、搜索引擎与 AI 代理”的场景。内容以 Markdown 和 YAML 撰写,构建时从同一份公开语料生成三类输出:面向人类读者的编辑风格网站(文章、系列、项目、个人资料、问答、主题、明暗主题);面向语言模型的机器可读产物(逐页 Markdown 镜像、llms.txt、llms-full.txt、结构化 JSON、OpenAPI);以及面向程序化客户端的发现元数据与可选查询接口。

内容模型有显式 schema:默认公开语料位于 content/ 目录,包含 articles、answers、pages、profile、projects、series 等子目录,文章 frontmatter 要求 title、description、contentType、pubDate、slug、llmSummary 等字段,构建时校验必填日期、slug、摘要、问答字段与内容类型。内容与主题解耦,contentRoot、publicDir、outDir 可配置,可把个人知识库或 monorepo 放在模板之外,仅用 Refined-X 作为发布层。

站点默认完全静态,可部署到 GitHub Pages、Cloudflare Pages、Netlify 或任意静态托管。默认的 /ask 在无模型、无数据库、无运行时费用的前提下检索精选问答与公开文章。可选的 Public Ask Worker 提供基于检索的实时问答,暴露受限的 NLWeb 兼容 /ask 端点与 Streamable HTTP MCP 服务(/mcp 上一个 ask 工具),并带有配额、速率限制、浏览器验证、来源链接与明确的能力边界;该服务不支持长期记忆、任意操作、诱导或冒充站点所有者。

README 明确列出其范围:它是静态优先的个人发布启动器、有主张的公开内容 schema,以及面向代理可读与可查询表面的参考实现;它不是托管 CMS,也不是私有个人系统。机器可读端点(llms.txt、逐页 .md、/api/*.json、/openapi.json、/.well-known/about.json)便于内容被摄取和连接,但不保证每个代理都会自动发现或调用。旧版草稿 MCP 发现路径(/.well-known/mcp.json 等)已在破坏性变更中移除,也不提供 /.well-known/ai-catalog.json。

Astro启动器

适合你的项目吗?

适用场景

  • 个人博客或作品集:用 Markdown 撰写文章、项目与个人资料,发布为静态网站
  • 希望内容被 AI 代理与语言模型读取:通过 llms.txt、逐页 Markdown 与 JSON API 暴露公开语料
  • 把个人知识库或 monorepo 作为内容源,Refined-X 仅作为发布层,通过 submodule 与 instance.config.mjs 接入
  • 在静态站基础上按需增加基于检索的实时问答与 MCP 查询能力
  • 需要文章评论但不想自建后端:接入 giscus 并复用 GitHub Discussions

适合人群

  • 以 Markdown 写作、希望同时服务读者与 AI 代理的个人发布者
  • 愿意维护自有仓库与内容 schema、偏好静态托管的开发者
  • 需要把内容与主题分离、将发布层嵌入现有知识库或 monorepo 的用户
  • 希望按需启用问答与 MCP 接口,而不默认引入运行时依赖的团队或个人

上手与定制指南

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

  1. 1

    通过 GitHub 模板或 npm create astro 初始化,安装依赖后运行 npm run dev 查看本地站点

  2. 2

    部署前依次运行 npm run check、test:public-ask、test:related、build、verify

  3. 3

    多数配置通过 instance.config.mjs 覆盖,也可修改 site.config.mjs 中的 site、title、locale、contentRoot、publicDir、outDir、brand 等字段

  4. 4

    启用评论需配置 giscus 的 repo、repoId、category、categoryId 四项,缺项会导致构建失败

  5. 5

    启用 Live Ask 需先部署 examples/public-ask-worker 中的 Cloudflare Worker,再在配置中填入 askUrl、mcpUrl、healthUrl

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 启用 giscus 评论后,访客必须拥有 GitHub 账号才能参与讨论;评论数据存放在公开的 GitHub Discussions 仓库中。
  • 实时问答(Live Ask)为可选功能,需自行部署 Cloudflare Worker 并承担相应基础设施与运行时成本;默认静态站点不包含该能力。
  • 使用浏览器端生成功能时,需在构建时配置 Cloudflare Turnstile 站点密钥,依赖该第三方验证服务。
  • 启用评论需安装 giscus GitHub App 并创建讨论分类,依赖 GitHub 平台与第三方应用。
  • assetSource 为可选的外部图片库配置,启用时需自行提供并维护该外部资源。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

Visitors need a GitHub account to participate.

README 原文

Optional Cloudflare Worker for grounded browser answers, NLWeb `POST /ask`, and MCP `ask`.

README 原文

Set `PUBLIC_TURNSTILE_SITE_KEY` at Astro build time when using browser generation.

README 原文

install the giscus GitHub App, create a discussion category, then copy the four public identifiers

README 原文

`assetSource` | unset | Optional external image library

README 原文
https://github.com/tower1229/Refined-X/blob/main/LICENSEhttps://github.com/tower1229/Refined-X/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

来源平台
Astro Themes
资料与维护参考分
资料较完整 · 83 / 100
技术栈
Astro
网站类型
启动器
这个分数如何计算

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

这个项目需要核对什么

记录的仓库更新时间
2026-09-18
截图检查日期
2026-10-02

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

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

查看当时使用的来源资料

SHA-256: 1cea9d09c0039139bb64d1ff0185e201cf7a469189dc64b50fbc0ace7b3eb0c3

2026-10-02T19:16:08.777Z

来源文件 / 仓库
English | [简体中文](README.zh-CN.md)

# Refined-X

## Your public interface for the agentic web

Publish once for people, search engines, and AI agents.

Refined-X is an opinionated personal publishing starter built with
[Astro](https://astro.build/) and [Starlight](https://starlight.astro.build/).
Write in Markdown and YAML; Refined-X turns the same public corpus into:

- a calm, editorial website for human readers;
- Markdown mirrors, `llms.txt`, and structured JSON for language models;
- OpenAPI and MCP discovery metadata for programmatic clients;
- an optional NLWeb-compatible Ask service for live, grounded Q&A.

Your content stays in your own repository or knowledge vault. The site is
static by default, and the AI service is optional.

[Live demo](https://demo.refined-x.com) ·
[Ask the demo](https://demo.refined-x.com/ask/) ·
[Use this template](https://github.com/new?template_name=Refined-X&template_owner=tower1229) ·
[Production example](https://refined-x.com)

![Refined-X home page](docs/screenshots/home.jpg)

## Why Refined-X?

Most personal sites publish HTML and stop there. That works for browsers, but
agents must still extract meaning from navigation, layout, and scripts.

Refined-X publishes one source corpus through three surfaces:

| Surface          | What it provides                                                        |
| ---------------- | ----------------------------------------------------------------------- |
| Human-readable   | Articles, series, projects, profile, answers, topics, light/dark themes |
| Machine-readable | Per-page Markdown, `llms.txt`, `llms-full.txt`, JSON APIs, OpenAPI      |
| Agent-queryable  | Static curated search, optional NLWeb `/ask`, optional MCP `ask` tool   |

```mermaid
flowchart LR
  A["Markdown + YAML"] --> B["Refined-X build"]
  B --> C["Editorial website"]
  B --> D["Agent-readable surfaces"]
  D --> E["Optional Public Ask"]
```

## What makes it different

### One corpus, multiple outputs

Articles, answers, projects, series, and public profile data share an explicit
content schema. Refined-X generates the website and every machine-readable
surface from that same source of truth.

### Content independent from the theme

`contentRoot`, `publicDir`, and `outDir` are configurable. Keep a personal
vault or monorepo outside the template, and use Refined-X only as the publishing
layer.

### Useful without an AI backend

The default site is fully static. `/ask` searches curated answers and public
articles without a model, database, or runtime bill.

### Live Q&A when you want it

The optional Public Ask Worker adds grounded retrieval and summarization through
a restricted NLWeb v0.55-compatible `/ask` endpoint and a dual-era Streamable HTTP MCP
server (one `ask` tool on `/mcp` for modern `2026-07-28` and legacy 2025 clients).
Offline dual-era integration runs in CI; product-client verification is recorded in
[`docs/mcp-client-support-matrix.md`](docs/mcp-client-support-matrix.md) (core: Claude Code modern + Codex CLI legacy on a synthetic mock backend; other clients stay `not_run`).
It includes quotas, rate limits, browser verification, source links,
and explicit capability boundaries.

### Designed for reading

Agent support is not allowed to turn the site into a dashboard. Refined-X keeps
an editorial, monochrome visual system with restrained motion and accessible
light/dark themes.

## Quick start

This repository is a GitHub template. Select
[Use this template](https://github.com/new?template_name=Refined-X&template_owner=tower1229),
or run:

```sh
npm create astro@latest -- --template tower1229/Refined-X
cd <project>
npm install
npm run dev
```

Then open the local URL printed by Astro.

Before deploying:

```sh
npm run check
npm run test:public-ask
npm run test:related
npm run build
npm run verify
```

## Choose a deployment mode

| Mode                    | Infrastructure                                              | Result                                                                             |
| ----------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Static                  | GitHub Pages, Cloudflare Pages, Netlify, or any static host | Website, local Ask search, Markdown, `llms.txt`, JSON, OpenAPI, discovery metadata |
| Static + external vault | Static host plus an external `contentRoot`                  | Same outputs while content remains outside the template                            |
| Live Ask                | Static site plus the reference Cloudflare Worker            | Grounded browser answers, NLWeb `/ask`, MCP `ask`, health endpoint                 |

Start static. Add Live Ask only when conversational access is useful.

## Deploy static site

| Path | Guide |
| ---- | ----- |
| GitHub Pages | Copy [`deploy/user-github-pages.yml`](deploy/user-github-pages.yml) → enable Pages (GitHub Actions) |
| Cloudflare Pages | Build `npm run build`, output `dist`, Node `24` |

Step-by-step: [`docs/deploy-static.md`](docs/deploy-static.md).

Cloudflare Pages: connect the repo in the [dashboard](https://dash.cloudflare.com/) ([git integration docs](https://developers.cloudflare.com/pages/get-started/git-integration/)). GitHub Pages: copy the workflow linked above.

## Content model

The default public corpus lives in `content/`:

```text
content/
  articles/**/*.md
  answers/**/*.md
  pages/**/*.md
  profile/
    person.yaml
    cooperation.yaml
    resume.md
  projects/*.{yaml,yml,json}
  series/
    series.json
    *.yaml
```

Article frontmatter is intentionally explicit:

```yaml
---
title: Building for humans and agents
description: A short description for readers and search engines.
contentType: article
pubDate: 2026-07-01
slug: humans-and-agents
series: notes
tags:
  - publishing
  - agents
llmSummary: A concise, evidence-grounded summary for machine-readable outputs.
---
```

The schema validates required dates, slugs, summaries, answer fields, and
content types during the build.

## Configure your site

For most installations, create an `instance.config.mjs` overlay. You can also
edit the defaults in [`site.config.mjs`](site.config.mjs):

```js
export default {
  site: "https://example.com",
  title: "Your Name",
  locale: "en",
  timeZone: "UTC",
  contentRoot: "./content",
  publicDir: "./public",
  outDir: "./dist",
  brand: {
    persona: "Your Name",
    homeHeading: "Your Name",
    homeLede: "What you publish and why it matters.",
  },
};
```

Common options:

| Field         | Default     | Purpose                                   |
| ------------- | ----------- | ----------------------------------------- |
| `locale`      | `en`        | UI language pack: `en` or `zh-CN`         |
| `contentRoot` | `./content` | Public Markdown/YAML corpus               |
| `publicDir`   | `./public`  | Static assets                             |
| `outDir`      | `./dist`    | Build output                              |
| `assetSource` | unset       | Optional external image library           |
| `brand.*`     | demo values | Public identity and home-page copy        |
| `ask.*`       | empty       | Optional Public Ask / MCP / health URLs; `protocolProfile` defaults to `undeclared` (set `dual-era` only after deployment acceptance) |
| `discovery.awp` | `false`   | Optional AWP 0.2 manifests; when `true`, emits byte-identical `/agent.json` and `/.well-known/agent.json` (phase-1 static reads only); llms does not auto-recommend them; subpath deploy limits — see plan §8.3 |
| `comments.*`  | empty       | Optional giscus repository and category   |

Relative paths resolve from the Refined-X package root.

## Enable article comments

Refined-X can load [giscus](https://giscus.app/) on article pages and keep the
discussion data in a public GitHub Discussions repository. Enable Discussions,
install the giscus GitHub App, create a discussion category, then copy the four
public identifiers from the giscus configuration page:

```js
export default {
  comments: {
    repo: "owner/repository",
    repoId: "R_...",
    category: "Comments",
    categoryId: "DIC_...",
  },
};
```

Leave all four fields empty to disable comments. A partial configuration fails
the build instead of silently publishing a broken surface. Refined-X uses a
stable `article:<entry.id>` discussion key, follows the site locale and theme,
and loads the third-party iframe lazily. Visitors need a GitHub account to
participate.

## Agent-readable surfaces

Every build exposes a predictable public interface:

| Endpoint                            | Purpose                                         |
| ----------------------------------- | ----------------------------------------------- |
| `/llms.txt`                         | Compact site map and important links for agents |
| `/llms-full.txt`                    | Full public text corpus                         |
| `/<page>.md`                        | Clean Markdown mirror of a public page          |
| `/api/profile.json`                 | Structured public identity                      |
| `/api/articles.json`                | Article catalog                                 |
| `/api/topics.json`                  | Topic catalog                                   |
| `/api/search-index.json`            | Static Ask/search corpus                        |
| `/openapi.json`                     | API and optional Ask/MCP contract (only declares configured remotes) |
| `/.well-known/about.json`           | Site capability summary                         |

These endpoints make the site easier to ingest and connect. They do not assume
that every agent automatically discovers or invokes them.

Legacy draft MCP discovery paths (`/.well-known/mcp.json`,
`/.well-known/mcp/catalog.json`, `/.well-known/mcp/server-card.json`) were
**removed** in a breaking change. Prefer the configured MCP endpoint URL,
OpenAPI, and `about.json`. Do not expect `/.well-known/ai-catalog.json`.

## Enable Live Ask

Optional Cloudflare Worker for grounded browser answers, NLWeb `POST /ask`, and
MCP `ask`. Package: [`examples/public-ask-worker`](examples/public-ask-worker).

**Deploy checklist and troubleshooting:** [`docs/deploy-live-ask.md`](docs/deploy-live-ask.md).

After the Worker is up, point the static site at it:

```js
export default {
  ask: {
    askUrl: "https://ask.example.com/ask",
    mcpUrl: "https://ask.example.com/mcp",
    healthUrl: "https://ask.example.com/health",
    // Optional. Default undeclared — do not claim modern dual-era until accepted.
    // protocolProfile: "dual-era",
  },
};
```

Set `PUBLIC_TURNSTILE_SITE_KEY` at Astro build time when using browser generation.
The hosted demo uses `https://ask-demo.refined-x.com/mcp`.

Live Ask intentionally does not support long-term memory, arbitrary actions,
elicitation, or impersonating the site owner.

## Use an external vault

Refined-X can live as a submodule inside a personal data repository:

```sh
git submodule add [email protected]:tower1229/Refined-X.git 90_Website/Template
```

Place `instance.config.mjs` next to the submodule, or set
`REFINED_X_INSTANCE_CONFIG`:

```js
export default {
  contentRoot: "../../20_Publish",
  publicDir: "../../30_Assets/Public",
  outDir: "../../dist",
};
```

Instance-specific settings stay outside the template, so upstream updates do
not overwrite your identity or content.

## Design

See [`DESIGN.md`](DESIGN.md) for the visual system, typography, component
rules, motion boundaries, and accessibility guidance.

![Refined-X cover — cascade](docs/community-cover/refined-x-cover-ink.png)

![Refined-X cover — collage](docs/community-cover/refined-x-cover-paper.png)

## Scope

Refined-X is:

- a static-first personal publishing starter;
- an opinionated public content schema;
- a reference implementation for agent-readable and agent-queryable surfaces.

Refined-X is not:

- a hosted CMS;
- a private personal agent;
- a long-term memory service;
- a promise of automatic MCP discovery in every client;
- a claim that every MCP client in the extended matrix has been product-verified (see [`docs/mcp-client-support-matrix.md`](docs/mcp-client-support-matrix.md)).

## Contributing

Issues, implementation reports, documentation improvements, and pull requests
are welcome. If you launch a site with Refined-X, open a showcase issue so it
can be included in the community gallery.

- [Contributing guide](CONTRIBUTING.md)
- [Changelog](CHANGELOG.md)
- [Security policy](SECURITY.md)
- [Roadmap](ROADMAP.md)

## License

[MIT](LICENSE)
反馈内容错误

看看同类模板

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