VOOZH about

URL: https://deepwiki.com/friendsofhyperf/components/11.2-documentation-site-architecture

⇱ Documentation Site Architecture | friendsofhyperf/components | DeepWiki


Loading...
Last indexed: 14 February 2026 (15d5ca)
Menu

Documentation Site Architecture

Purpose and Scope

This document describes the architecture of the friendsofhyperf/components documentation website, which is built using VitePress and serves four locales (Simplified Chinese, Traditional Chinese Hong Kong, Traditional Chinese Taiwan, and English). The documentation covers the configuration system, multi-locale organization, content structure, and deployment workflow.

For information about the CI/CD pipeline that builds and deploys the documentation, see CI/CD Pipeline. For information about the overall monorepo structure, see Monorepo Architecture and Component Registry.


VitePress Foundation

The documentation site is built on VitePress, a Vue.js-powered static site generator optimized for technical documentation. VitePress provides built-in features including Markdown rendering, Vue component support, theming, search, and internationalization.

Core Configuration

The main configuration file docs/.vitepress/config.mts1-179 defines the site-wide settings:

Configuration KeyPurposeValue
titleSite title"Hyperf Fans"
descriptionSEO description"🚀 The most popular components for Hyperf."
ignoreDeadLinksAllow broken links during buildtrue
sitemap.hostnameSitemap generationhttps://docs.hdj.me

The configuration includes analytics integration via script tags in the head section docs/.vitepress/config.mts26-51:

  • Baidu Analytics (hm.baidu.com) for Chinese market tracking
  • Microsoft Clarity (clarity.ms) for user behavior analysis

Markdown Extensions

The site uses the markdown-it-task-lists plugin docs/.vitepress/config.mts19-106 to enable GitHub-style task list rendering in Markdown files:


Sources: docs/.vitepress/config.mts1-179


Multi-Locale Architecture

The documentation site supports four locales with independent navigation, sidebar, and content hierarchies:


Diagram: Multi-Locale Configuration Structure

Locale Configuration System

Each locale is defined in the locales object docs/.vitepress/config.mts52-100 with the following structure:

Locale KeyLabelLanguage CodeLink Pattern
root"简体中文"zh/ (default)
zh-hk"繁體中文(港)"zh-hk/zh-hk/index
zh-tw"繁體中文(臺)"zh-tw/zh-tw/index
en"English"en/en/index

Each locale imports three separate modules:

  1. Config Module: Title, description, tagline (docs/.vitepress/src/en/config.ts1-5)
  2. Navigation Module: Top-level navigation items (docs/.vitepress/src/en/nav.ts1-14)
  3. Sidebar Module: Component-specific sidebar hierarchies (imported but not shown in provided files)

Theme Configuration Per Locale

Each locale receives its own themeConfig object docs/.vitepress/config.mts63-98 containing:


The root locale (Simplified Chinese) uses a different configuration pattern docs/.vitepress/config.mts110-177 where theme settings are defined at the top level rather than nested under themeConfig in the locale definition.

Sources: docs/.vitepress/config.mts52-100 docs/.vitepress/src/en/config.ts1-5 docs/.vitepress/src/en/nav.ts1-14


Navigation and Sidebar Organization

Navigation Structure

The navigation system uses VitePress's DefaultTheme.NavItem[] type. The English navigation docs/.vitepress/src/en/nav.ts3-12 demonstrates the structure:


Diagram: English Navigation Hierarchy

Navigation items support two types:

  1. Direct Links: Single-level navigation items with text and link properties
  2. Dropdown Menus: Items with an items array containing nested links, used for external resources

Sidebar Organization

While the sidebar configuration files are not provided in the file listing, the configuration imports show they follow a modular pattern:

The sidebar configuration uses VitePress's hierarchical structure to organize component documentation by category, mirroring the component catalog structure described in Component Catalog.

Sources: docs/.vitepress/src/en/nav.ts1-14 docs/.vitepress/config.mts1-179


Search Functionality

The documentation site implements local search using VitePress's built-in search provider docs/.vitepress/config.mts128-166:


Diagram: Search System Architecture

Search Configuration

The search system is configured with locale-specific translations docs/.vitepress/config.mts131-164:

LocaleButton TextNo Results TextSelect TextNavigate Text
zh"搜索文档""无法找到相关结果""选择""切换"
en"Search documents""No relevant results found""Select""Switch"

The search index is generated at build time by parsing all Markdown files in the documentation directory. The local provider eliminates the need for external search services and provides instant search results without network latency.

Sources: docs/.vitepress/config.mts128-166


Theme Configuration and UI Customization

Content Navigation Features

The default theme is customized with Chinese translations for UI elements docs/.vitepress/config.mts111-127:

FeatureConfiguration KeyChinese ValuePurpose
Outline Labeloutline.label"页面导航"Right sidebar heading
Outline Levelsoutline.level[2, 4]Show H2-H4 headings
Edit Link TexteditLink.text"在Github上编辑此页面"GitHub edit button
Edit Link PatterneditLink.patterngithub.com/.../docs/:pathEdit URL template
Last UpdatedlastUpdated.text"最后更新于"Git timestamp label
Next PagedocFooter.next"下一页"Footer navigation
Previous PagedocFooter.prev"上一页"Footer navigation
Sidebar MenusidebarMenuLabel"菜单"Mobile menu label
Return to TopreturnToTopLabel"回到顶部"Scroll button

GitHub Integration

The edit link pattern docs/.vitepress/config.mts116 enables direct editing:

https://github.com/friendsofhyperf/components/edit/main/docs/:path

The :path placeholder is automatically replaced with the relative path of the current page, allowing readers to contribute corrections directly via GitHub's web editor.

Sources: docs/.vitepress/config.mts110-127


Home Page Structure

The root home page docs/index.md1-50 uses VitePress's home page layout with the following structure:


Diagram: Home Page Content Structure

The home page showcases 10 featured components docs/index.md17-47 with title, description, and link. Each feature block is rendered as a card in the features grid. The hero section provides two primary calls-to-action:

  1. 组件 (Components): Links to the component catalog
  2. GitHub: Links to the source repository

Sources: docs/index.md1-50


Build and Deployment Pipeline

Build Configuration

The VitePress build process generates static HTML files from Markdown sources. The configuration enables several build-time optimizations:

  1. Sitemap Generation: Automatically creates sitemap.xml for SEO docs/.vitepress/config.mts107-109
  2. Dead Link Checking: Disabled via ignoreDeadLinks: true docs/.vitepress/config.mts25 to allow external links without validation
  3. Multi-Locale Output: Generates separate directory structures for each locale

Deployment Workflow

Based on the context from CI/CD Pipeline, the documentation site is deployed through the release.yaml GitHub Actions workflow. The deployment process:

  1. Triggers on Git tags matching version patterns
  2. Builds the VitePress site using vitepress build docs
  3. Deploys the static output to the hosting provider
  4. Updates the sitemap at https://docs.hdj.me

Directory Structure


Diagram: Documentation Directory Structure

The docs/.vitepress/ directory docs/.vitepress/config.mts1 contains all VitePress configuration and theme customizations, while locale-specific content lives in top-level directories (en/, zh-cn/, etc.). Configuration modules are organized under .vitepress/src/<locale>/ for modularity.

Sources: docs/.vitepress/config.mts1-179 docs/index.md1-50


Analytics and Monitoring Integration

The documentation site integrates two analytics platforms via inline scripts in the HTML head docs/.vitepress/config.mts26-51:

Baidu Analytics

Integrated via Baidu's hm.js script docs/.vitepress/config.mts31-38 Tracks:

  • Page views and unique visitors
  • Geographic distribution (primarily Chinese users)
  • Referral sources and search keywords
  • User engagement metrics

The tracking ID df278fe462855b3046c941a8adc19064 is hardcoded in the configuration.

Microsoft Clarity

Integrated via Clarity's tracking script docs/.vitepress/config.mts43-49 Provides:

  • Session recordings and heatmaps
  • User interaction tracking
  • Dead click and rage click detection
  • Scroll depth analysis

The project ID pgqv4ftymf is embedded in the script initialization.

Both scripts load asynchronously to minimize impact on page load performance.

Sources: docs/.vitepress/config.mts26-51


Configuration Module Pattern

The documentation architecture follows a modular configuration pattern where each locale's settings are split into separate TypeScript files:


Diagram: Configuration Module Assembly Pattern

Module Import Pattern

The main configuration docs/.vitepress/config.mts3-17 imports locale-specific modules:


These modules are then spread into locale definitions docs/.vitepress/config.mts86-99:


This pattern enables:

  1. Maintainability: Each locale's configuration is isolated
  2. Reusability: Configuration modules can be shared or extended
  3. Type Safety: TypeScript ensures configuration schema compliance
  4. Code Organization: Related settings are co-located

Sources: docs/.vitepress/config.mts1-179 docs/.vitepress/src/en/config.ts1-5 docs/.vitepress/src/en/nav.ts1-14


Summary

The friendsofhyperf/components documentation site architecture demonstrates a well-organized VitePress implementation with:

AspectImplementation
Static Site GeneratorVitePress with Vue.js
Localization4 locales with independent navigation/sidebar
ConfigurationModular TypeScript files per locale
SearchLocal provider with build-time indexing
AnalyticsBaidu Analytics + Microsoft Clarity
DeploymentGitHub Actions via release.yaml
Hostinghttps://docs.hdj.me
Content FormatMarkdown with YAML frontmatter

The modular configuration system and comprehensive locale support make the documentation easily maintainable and scalable as the component library grows. The local search provider and analytics integration provide excellent user experience and usage insights.