Docs
Getting started
快速开始
Taking a new Next.js site from zero to authoring: what you need, install, the config file, the three routes you mount, the theme, and running it locally.
Page families and content types
页面家族与内容类型
A content type is a structural contract, defined once in code. A page family is one recurring editorial purpose in a site, reusing a type and adding route, labels and editorial policy. Together they draw the boundary of what AIBlog manages.
The DOM contract and theming
DOM 契约与主题化
The renderer emits structure, class hooks and data attributes, and nothing else. This page sets out the two attribute families, the document shell, the token-first approach a theme should take, and the theme-swap test that keeps styles separate from content.
Editing, drafts and publishing
编辑、草稿与发布
A page carries a draft pointer and a published pointer. Every change writes a new revision, the public route reads the published one, and pending drafts are surfaced rather than forgotten.
Search on Firestore
在 Firestore 上实现搜索
Firestore covers every structural query through composite indexes but does no full-text search. AIBlog derives a compact search projection on publish, indexes it in each server process with a CJK bigram tokenizer, and closes the cross-lingual gap with per-block embeddings and native vector search.
The composer and the authoring loop
撰写器与创作循环
An editor pastes text, drops photos and presses Generate; the model answers with the whole page as one typed object. What each turn sends, what the server validates, and what the editor reads back.
Four designs, one document
四套设计,同一份文档
The Theme menu swaps the stylesheet while the documents, the DOM and the data stay the same. How the three layers of CSS, the cookie-driven switch, the token-first order and the theme-swap test fit together — and what one client theme costs to write.
Embeddings and retrieval
嵌入向量与检索
Anything that turns on meaning rather than characters runs on embeddings: related pages, cross-lingual search, composer references and the visitor question box. One vector per block, computed on publish, stored in Firestore.
The question box and its cost guardrails
提问框及其成本护栏
The Ask the site box is the only model call a visitor can trigger without logging in. What one answer costs, the gates in front of it cheapest first, where the four limits live, and the vendor-console cap that holds when counters fail.
Deploying a site
部署站点
Two deploy targets — Cloud Run from source, or a standalone bundle behind nginx on a virtual machine — plus the audit gate, the least-privilege service account, the security headers, the secrets and the indexes each deploy depends on.
Configuration reference
配置参考
One file describes a site: site identity, page families and their editorial policies, voice, preview route, ask limits, admin locale and services — in the order they appear in this site's own configuration.
Handing a site to a client
把站点交付给客户
The last step of a client project is a manual and a boundary: what the client's staff do alone, what needs the developer, what the developer supplies per client, and the one recurring duty the owner keeps.
- Load more