Watch
1
0
Fork
You've already forked model-distribution
0
CarbonC's Model Distribution https://models.carbonc.cc/
  • Astro 95.6%
  • TypeScript 3.3%
  • JavaScript 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-05 08:33:17 -07:00
.vscode "Initial commit from Astro" 2026-08-05 04:45:46 -07:00
public init 2026-08-05 08:03:55 -07:00
src content: fix name 2026-08-05 08:33:17 -07:00
.gitignore "Initial commit from Astro" 2026-08-05 04:45:46 -07:00
AGENTS.md "Initial commit from Astro" 2026-08-05 04:45:46 -07:00
astro.config.mjs "Initial commit from Astro" 2026-08-05 04:45:46 -07:00
CLAUDE.md "Initial commit from Astro" 2026-08-05 04:45:46 -07:00
package-lock.json "Initial commit from Astro" 2026-08-05 04:45:46 -07:00
package.json "Initial commit from Astro" 2026-08-05 04:45:46 -07:00
README.md fix: add forced https prefix 2026-08-05 08:27:53 -07:00
SPECS.md init 2026-08-05 08:03:55 -07:00
tsconfig.json "Initial commit from Astro" 2026-08-05 04:45:46 -07:00
wrangler.jsonc chore: switch to cf workers 2026-08-05 08:21:58 -07:00

CarbonC's Model Distribution

石炭碳的 BJD 模型分发站。基于 Astro 的纯静态站点,托管于 Cloudflare Workers(静态资源模式),模型文件存放于 Cloudflare R2。

本地开发

npm install
npm run dev        # 开发服务器,默认 localhost:4321
npm run build      # 构建到 dist/
npm run preview    # 预览构建结果

环境变量

部署前需设置 Cloudflare R2 公网域名:

export R2_DOMAIN="your-bucket.r2.cloudflarestorage.com"

或在 Cloudflare Workers 控制台添加环境变量:R2_DOMAIN。

上新模型

每次上新只需三步:

  1. 上传文件到 R2(用 S3 客户端或 Cloudflare 控制台)

    • 预览图:previews/{filename}.webp
    • 模型包:models/{filename}.zip
  2. 在仓库中新增数据文件 src/content/models/{随便取个名}.yml:

title: "MSD 素体 1/4"      # 展示标题,允许任意字符
filename: "msd-body-1-4"    # R2 文件名,不含后缀,仅安全字符
date: 2026-08-05            # 排序用,新的排前面
  1. Push 到 GitHub — Cloudflare Workers 自动触发构建和部署。

项目结构

src/
├── content/
│   └── models/          # 每个模型一个 yml
├── content.config.ts    # 数据校验规则
├── components/
│   ├── BaseLayout.astro # 全局布局
│   ├── ModelCard.astro  # 单个模型卡片
│   └── ModelGrid.astro  # 介绍区 + 卡片列表 + 分页
└── pages/
    ├── index.astro      # 首页(第 1 页)
    └── [page].astro     # 第 2 页起

颜色参考

用途 色值
背景 #1a1b2e
卡片 #262840
标题 #e4dff4
正文 #d0d0e0
Blog 链接 #80cfdc
Bluesky 链接 #5090d0
Ko-fi 按钮 #c06090