Architecture
This section consolidates key enhancements and the current technical architecture:
1. Enhancements
- Automatic Versioning: Eliminated
VERSION.txt, now usesPreBuild.getVersion()for on-the-fly YYYY.MM.DD versions. - README Integration: Markdown files from project root are copied to
src/pagesand indexed for navigation via pre-build. - Navbar Autogeneration: Scans root
.mdfiles and emitssrc/navbarLinks.tsbefore each build. - Badge System:
BadgeConfigstatic class +useConfighook for dynamic GitHub badges. - Comments:
GiscusConfigstatic class for Giscus-powered discussions. - Theme System: Ten built-in themes in
static/themes/with live light/dark switching.
2. Architecture
- Scripts: TypeScript class
PreBuildhandles both content preparation and versioning. - Components: Modular React hooks and components for badges and comments.
- Config Classes: Strongly-typed classes (
BadgeConfig,GiscusConfig,VersionConfig) replace JSON imports for static access.
3. Workflow
- Development:
npm startruns pre-build tasks then startsdocusaurus start. - Production Build:
npm run buildtriggers pre-build, thendocusaurus build. - Type Checking:
npm run typecheckensures all TS scripts and components validate.