sakura个人站点模板
  • Astro 41.7%
  • TypeScript 17.1%
  • CSS 12.2%
  • Svelte 11.1%
  • Stylus 9.6%
  • Other 8.3%
Find a file
2026-09-26 10:56:08 +08:00
.github/workflows Initial template 2026-09-26 10:56:08 +08:00
.vscode Initial template 2026-09-26 10:56:08 +08:00
public Initial template 2026-09-26 10:56:08 +08:00
scripts Initial template 2026-09-26 10:56:08 +08:00
src Initial template 2026-09-26 10:56:08 +08:00
.env.example Initial template 2026-09-26 10:56:08 +08:00
.gitattributes Initial template 2026-09-26 10:56:08 +08:00
.gitignore Initial template 2026-09-26 10:56:08 +08:00
.npmrc Initial template 2026-09-26 10:56:08 +08:00
astro.config.mjs Initial template 2026-09-26 10:56:08 +08:00
biome.json Initial template 2026-09-26 10:56:08 +08:00
frontmatter.json Initial template 2026-09-26 10:56:08 +08:00
LICENSE Initial template 2026-09-26 10:56:08 +08:00
package.json Initial template 2026-09-26 10:56:08 +08:00
pagefind.yml Initial template 2026-09-26 10:56:08 +08:00
pnpm-lock.yaml Initial template 2026-09-26 10:56:08 +08:00
postcss.config.mjs Initial template 2026-09-26 10:56:08 +08:00
README.md Initial template 2026-09-26 10:56:08 +08:00
svelte.config.js Initial template 2026-09-26 10:56:08 +08:00
tailwind.config.cjs Initial template 2026-09-26 10:56:08 +08:00
tsconfig.json Initial template 2026-09-26 10:56:08 +08:00
vercel.json Initial template 2026-09-26 10:56:08 +08:00
启动预览.cmd Initial template 2026-09-26 10:56:08 +08:00

桜色时刻 · Sakura Moments

基于 Astro 和 Fuwari 的樱花风格静态博客模板。以樱花粉、酒红和古金色为主色,内置文章、归档、友链与关于页面。

功能

  • Markdown 文章、分类、标签与文章目录
  • 中文全文搜索、RSS 和站点地图
  • 亮色、暗色与跟随系统主题
  • 桌面与移动端布局
  • 可替换的横幅、头像、站点名称和示例文章

开始使用

环境:Node.js 22 或更高版本、pnpm 9.14.4。

pnpm install --frozen-lockfile
pnpm dev

访问 http://localhost:4321/。Windows 用户也可以双击「启动预览.cmd」。

开发服务器会即时更新页面。全文搜索使用构建时生成的索引,查看完整效果:

pnpm build
pnpm preview

自定义

文件或目录 内容
src/config.ts 站名、简介、显示名称、导航、横幅和语言
src/content/posts/ Markdown 文章
src/content/spec/about.md 关于页面
src/pages/friends.astro 友链页面
src/styles/sakura.css 樱花主题样式
src/components/SakuraHero.astro 首页横幅文案
src/components/widget/Profile.astro 侧栏卡片
src/assets/images/ 图片素材

新建文章:

pnpm new-post my-first-post

文章头部支持 title、published、description、image、tags、category 和 draft 等字段。设置 draft: true 可隐藏文章。

内置站名、Sakura 显示名称、主题插画和三篇文章均可替换。

构建与部署

在构建环境中设置 SITE_URL 为正式站点地址,例如 https://example.com/,然后运行:

pnpm check
pnpm build

PowerShell 中可以这样设置地址:

$env:SITE_URL = "https://example.com/"
pnpm build

将 dist/ 内全部文件部署到静态托管服务的网站根目录。站点运行不需要 Node.js 服务,搜索索引也包含在该目录中。未设置 SITE_URL 时使用本地预览地址。

使用仓库连接托管平台时:

设置 值
安装命令 pnpm install --frozen-lockfile
构建命令 pnpm build
输出目录 dist
环境变量 SITE_URL=https://example.com/

GitHub 工作流会执行依赖安装、类型检查和完整构建。依赖、构建产物、本地环境文件及日志已加入 .gitignore。

来源与许可证

主题基于 Fuwari,代码沿用 MIT 许可证,见 LICENSE。内置横幅为樱花与时崎狂三主题的示例插画,并非官方素材。