This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a VitePress-based documentation site for DPanel, a lightweight Docker/Podman container management panel. The site supports Chinese (zh-CN) and English (en-US) languages.
# Install dependencies
npm install
# Start development server
npm run docs:dev
# Build for production
npm run docs:build
# Preview production build
npm run docs:previewThe config file performs critical build-time operations before VitePress configuration:
-
Auto-generates
upgrade.md: Fetches latest releases from GitHub API (donknap/dpanel) and generates bothdocs/zh-CN/upgrade.mdandstorage/api/upgrade.json. This happens viaawait generateUpgradeDocs()at the top level. -
Injects "New" badges: The
injectNewBadge()function walks the sidebar configuration, checks each linked file's last git commit time, and adds a<span class="vp-badge-new">New</span>badge to files modified within 30 days. Files checked viagit log -1 --format=%ct.
- Locales:
.vitepress/locales/zh-CN.tsand.vitepress/locales/en-US.tsexport sidebar/nav configurations - Helper function:
getLink()handles path prefixing—Chinese uses/path, English uses/docs/en-US/path - Rewrite rule: In
config.mts,rewrites: { 'docs/zh-CN/:rest*': ':rest*' }maps Chinese docs to root
Use VitePress include directive to avoid duplication:
<!--@include: ../include/image.md-->
<!--@include: ../include/yaml.md-->Reusable fragments live in docs/zh-CN/include/ and docs/en-US/include/.
.vitepress/theme/index.ts: Extends default VitePress theme, injects custom components via layout slots (e.g.,home-hero-afterfor DPAds).vitepress/theme/style.css: Custom CSS variables for theming- Components in
.vitepress/components/:DPAds.vue(ads),PartnerList.vue(homepage partners)
Images use medium-zoom for lightbox functionality. Add data-zoomable attribute to enable.
Sidebar is organized by feature areas:
install/- Installation methodsmanual/- User guides (container management, compose, images, system settings)include/- Reusable content snippets
Use getLink("path") in locale configs for consistent path handling across languages.
Mark features requiring minimum DPanel version: <Badge type="tip" text="DPanel Version >= 1.8.1" />
Highlight specific lines in code examples using the // [!code focus] comment syntax.
---
next: false # Hide next/prev navigation
aside: false # Hide aside table of contents
layout: home # Use homepage layout
---- Static assets (images, scripts) live in
storage/ storage/api/contains JSON data files (likeupgrade.json) for potential API use- Git history drives the "New" badge system—avoid rewriting history on doc files if you want accurate badge display