This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm run docs:dev # Dev server (http://localhost:5173)
npm run docs:build # Production build → docs/.vitepress/dist
npm run docs:preview # Preview production build
npm install # Install deps (CI uses npm ci with Node 20)No test runner or linter is configured.
VitePress 1.6.4 documentation site for ModelGo Licenses — a standard for model publishing. Deployed to GitHub Pages at https://www.modelgo.li.
Custom theme extends VitePress DefaultTheme (docs/.vitepress/theme/):
- Layout.vue — wraps DefaultTheme.Layout with two injections:
#home-hero-imageslot →LicenseSelector(async, home page only)#layout-bottomslot →PixelRobots(async,<ClientOnly>for SSR safety)- Busuanzi analytics via manual JSONP in
onMounted
- custom.css — frosted-glass feature cards, banner background, timeline UI, RTL fix for Arabic, mobile breakpoints at 959px/640px
LicenseSelector.vue — interactive license picker with 8 license variants, badge system, download/copy, and model sheet generation. Uses license-i18n.ts for translations keyed by VitePress lang values (zh-CN, zh-TW, ja, etc.).
PixelRobots.vue (~2000 lines) — real-time SVG physics simulation at page bottom. Critical patterns:
shallowRef+triggerReffor all entity arrays (rabbits, mushrooms, grasses, etc.) — deep reactivity would be too expensive for per-frame mutations. Always mutate in-place, then calltriggerRef().- rAF loop with
dtnormalized to 16ms (60fps target), clamped to max 3 to prevent physics explosions on tab resume. - Sky recomputed every 60 frames (
SKY_UPDATE_INTERVAL), not every tick. - Physics:
GRAVITY=0.25,BOUNCE=0.45,WALK_SPEED_MIN=0.35,WALK_SPEED_MAX=0.7. - Entities: rabbits (3, draggable, growth from mushrooms, trip effects, speech bubbles), mushrooms (3 types, grow over 25s), grasses (4 cluster styles, bend with wind/rabbits), butterflies, snails, clouds, weather particles, stars, rainbows, spores, hidden snakes.
- Moon phase calculated from known epoch (Jan 6, 2000 new moon). Weather is season-weighted random.
ResizeObserveron.VPFooterfor responsive scene sizing.
Supporting data files:
pixel-palettes.ts— color definitions for all creaturesrabbit-thoughts.ts— speech bubble strings in 8 languages, 3 thought categories (idle, trip, baby)
VideoEmbed.vue — globally registered iframe wrapper, usable as <VideoEmbed url="..." caption="..." /> in any markdown file.
English (root), zh, zh-tw, ja, ko, ru, es, fr, ar (RTL).
- VitePress UI strings: all inline in
config.mtsunder each locale'sthemeConfig - Content: mirrored
.mdstructure per locale directory (docs/zh/,docs/ja/, etc.) - Component translations:
license-i18n.tsandrabbit-thoughts.tseach have their own lookup, with English fallback - Locale detection: components read VitePress's
useData().langvalue
cleanUrls: true,lastUpdated: true- Markdown plugin:
vitepress-plugin-tabs(enables:::tabssyntax) - Search: local provider
nav()andsidebar()are helper functions that take translated strings + locale prefix as arguments- Social links: GitHub + Google Scholar (custom SVG)
GitHub Actions workflow (.github/workflows/deploy.yml) deploys to GitHub Pages on push to main or manual trigger. Uses Node 20, npm ci, npm run docs:build.