This document describes how to build the DDNS documentation website using VitePress.
The documentation is built using VitePress - a Vue-powered static site generator specifically designed for documentation websites.
响应式导航
双语支持 (Bilingual Support)
页内目录 (Table of Contents)
搜索功能 (Search)
主题切换 (Theme Toggle)
GitHub 集成
代码高亮 (Code Highlighting)
One command to install, setup, and build:
npm install
npm run build
This automatically:
npm run build
This command automatically:
Output: docs/.vitepress/dist/ directory
Start the development server (auto-setup included):
npm run docs:dev
Then open http://localhost:5173 in your browser.
Build the static site:
npm run docs:build
Preview the production build locally:
npm run docs:preview
.
├── package.json # Node.js dependencies and scripts
├── build_docs.sh # Build script
├── docs/ # VitePress docs directory
│ ├── .vitepress/ # VitePress configuration
│ │ ├── config.mts # Main configuration file
│ │ └── dist/ # Built static site (after build)
│ ├── index.md # Homepage (Chinese)
│ ├── doc/ # Documentation files (Chinese)
│ │ ├── config/ # Configuration guides
│ │ ├── providers/ # DNS provider documentation
│ │ └── dev/ # Developer documentation
│ └── en/ # English version
│ ├── index.md # Homepage (English)
│ └── doc/ # Documentation files (English)
The main configuration file is docs/.vitepress/config.mts. It includes:
To customize the documentation:
docs/.vitepress/config.mts for configurationdocs/ directorydocs/doc/**/*.mddocs/en/doc/**/*.en.mddocs/doc/ directoryconfig.mtsnpm run docs:dev to preview.en.md extensiondocs/en/doc/npm run docs:dev to previewVitePress supports enhanced markdown features:
```js
console.log('Hello, World!')
```
::: tip
This is a tip
:::
::: warning
This is a warning
:::
::: danger
This is a danger notice
:::
::: details Click to expand
This is hidden by default
:::
::: code-group
sh [npm] npm install vitepress
sh [pnpm] pnpm add vitepress
:::
::: info Custom Title
This is an info box with custom title
:::
See VitePress Markdown Features for more.
The built static site in docs/.vitepress/dist/ can be deployed to:
gh-pages branchdist/ contents# .github/workflows/deploy.yml
name: Deploy Docs
on:
push:
branches: [master]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: bash build_docs.sh
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
✅ Faster than Jekyll/Hugo - Vite-powered instant HMR
✅ More flexible than Docusaurus - Lighter weight, Vue ecosystem
✅ Better i18n than Sphinx - Built-in multi-language support
✅ Easier than custom solutions - Configuration over code
✅ Modern developer experience - Vue 3, TypeScript, Vite
✅ Chinese-friendly - Excellent Chinese documentation and community
If you encounter errors, ensure you're using Node.js 18+ or 20+:
node --version # Should be v18.x.x or v20.x.x
If port 5173 is in use, specify a different port:
npm run docs:dev -- --port 8080
Clear cache and reinstall:
rm -rf node_modules package-lock.json docs/.vitepress/cache
npm install
npm run docs:build
This build configuration is part of the DDNS project and is licensed under the MIT License.