Skip to content
lin-snowPublic

About

Sn0w -- A minimal personal homepage

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

Sn0w

L1nSn0w 的个人站点。

开发

需要 Node.js 22.12+ 与 bun。

bun install
bun run dev

检查、格式化与构建:

bun run check         # astro check
bun run format        # prettier --write .
bun run test          # 内容发布规则测试
bun run build         # astro build → dist/
bun run preview       # 预览 dist/

内容

  • src/config.ts:站点名称、描述、导航、社交链接。
  • src/content/posts/<slug>/index.md:文章。目录名即 slug(小写 kebab-case); frontmatter 需要非空 title 与引号包围的 YYYY-MM-DD 日期; draft: true 会从首页、正文和 RSS 中排除。正文从 ## 开始。
  • src/content/pages/home.md、about.md、projects.md:页面文案。
  • 文章图片与 index.md 放在同一目录,用 ./file.webp 引用;多图段落可以写成 :::gallery 网格(见现有文章)。Astro 会统一处理尺寸、懒加载和哈希文件名。

部署

推送到 main 后,Cloudflare 上该 Worker 的 Git 构建会安装依赖、运行构建并把 dist/ 发布为 Workers Static Assets,站点随即更新。.github/workflows/deploy.yml 同时在 GitHub Actions 里跑检查、测试与构建;只有仓库另配了 CLOUDFLARE_API_TOKEN、CLOUDFLARE_ACCOUNT_ID 两个 secret 时,它才会额外执行 wrangler deploy 作为兜底。

构建默认用 https://sn0w.fyi/ 生成 canonical、Open Graph 与 RSS 绝对地址, 需要换域名或部署预览版时用 SITE_URL 覆盖。Cloudflare 配置在 wrangler.jsonc: ./dist 作为静态资源目录,未知路径返回 dist/404.html。

About

Sn0w -- A minimal personal homepage

Resources

Stars

4 stars

Watchers

0 watching

Forks

Contributors

Languages