# Install dependencies
yarn
# Start dev server (localhost)
yarn docs:dev
# Start dev server with clean cache
yarn docs:dev-clean
# Build for production
yarn docs:build
# Preview production build locally
yarn docs:preview
# Update VuePress and theme
yarn vp-updateNote: There are no unit tests in this project - it's a static site generator blog.
swiftdo.github.io/
├── docs/ # Documentation source
│ ├── .vuepress/ # VuePress config & theme
│ │ ├── config.ts # Main VuePress config
│ │ ├── plume.config.ts # Theme config (hot-reload)
│ │ ├── navbar.ts # Navigation config
│ │ └── notes.ts # Sidebar/note collections
│ ├── notes/ # Technical notes (Swift, Flutter, AI, etc.)
│ ├── article/ # Blog articles
│ └── book/ # Book recommendations
├── package.json
└── deploy.sh # Deployment script
- Strict mode enabled via VuePress defaults
- ES Modules -
"type": "module"in package.json - Use ESM imports:
import { X } from 'package' - Export configs with
export default - Use
defineXConfighelper functions from vuepress-theme-plume for type safety
- Import order: Node built-ins → npm packages → local files
- Use
.tsextension for local imports - Group imports logically (VuePress, theme, utilities)
- Files: kebab-case (
plume.config.ts,navbar.ts) - Variables/Functions: camelCase
- Constants: UPPER_CASE (for static values)
- Components: PascalCase
import { defineNoteConfig } from 'vuepress-theme-plume'
const swiftNote = defineNoteConfig({
dir: 'swift',
link: '/swift',
sidebar: 'auto',
})All markdown files should include frontmatter:
---
title: Your Title
createTime: 2025/01/24 10:00:00
permalink: /article/xxx/
---Notes are configured in docs/.vuepress/notes.ts:
dir: Directory name underdocs/notes/link: URL prefix for generated pagessidebar:'auto'for file-structure-based, or array for manual order
Critical: Markdown file permalinks must start with the note's link prefix for sidebar to appear.
- Use TypeScript for compile-time safety
- No runtime error handling needed for static config files
- Build errors will surface via VuePress CLI
# Run deploy script (builds + rsync to server + git push)
./deploy.sh- Commit with descriptive messages
- Push to remote after local testing
- Deployment happens via
deploy.shscript
This site uses vuepress-theme-plume with:
- Blog functionality (tags, archives, categories)
- Dark mode support
- Local search
- Code highlighting
- Google Analytics
- Copy code plugin
- Bulletin announcements
- Group related content in subdirectories (e.g.,
notes/swift/ios/,notes/ai/ml/) - Each topic should have a
README.mdas landing page - Use
t1-,t2-prefixes for ordered content - Use
u1-,y1-for supplementary content