How gezhiheng/henrys-blog works
The project is a personal blog built using VitePress—a static site generator primarily used for documentation and blogs. The file tree and README provide clear guidance that this is a content-driven website with custom theming, automated utilities, and CI/CD deployment scripts.
Main components
• Content & Documentation:
• The “docs” directory contains various Markdown files for posts, tutorials, experiences, and study notes.
• The “index.md” file likely acts as the landing page.
• Custom VitePress Configuration & Theming:
• The “.vitepress” directory holds configuration files (config.mjs, sidebar.js) and theme customizations (Layout.vue, ProjectCard.vue, custom.css, etc.).
• Assets & Public Files:
• The “assets” directory (and subfolders under “public/assets”) store fonts, images, and other media.
• Utility Scripts:
• Files in the “utils” folder (e.g., genContents.js and genRecentPosts.js) suggest automated content generation or updates for recent posts.
• Build & Dependency Management:
• “package.json” and “package-lock.json” manage dependencies and script commands related to VitePress.
• CI/CD Pipeline:
• The “.github/workflows/deploy.yml” indicates an automated deployment process (likely triggered on pushes or PR merges).
• Ancillary Files:
• “info.txt”, “LICENSE”, and “README.md” contain meta-information, licensing, and project guidelines.
Relationships & Data Flow
• The VitePress engine uses configuration files from “.vitepress/config.mjs” and “.vitepress/theme” to parse Markdown content from “docs” and “index.md”, converting them into HTML.
• Static assets (in “assets” and “public”) are referenced within the content and theme, maintaining a cohesive visual identity.
• Utility scripts read or process content (possibly updating navigation, generating recent posts) and feed data to VitePress during the build process.
• Deployment is automated through the GitHub Actions workflow defined in “.github/workflows/deploy.yml” that takes the built static files and deploys them to the appropriate hosting service.
Architectural Patterns & Design Principles
• Modular Design: Separation of content (docs, index.md), presentation (theme files under .vitepress/theme), and business logic (utility scripts).
• Static Site Generation: Using VitePress to transform Markdown content into static HTML, optimizing loading speeds and reliability.
• Automated Deployment: CI/CD integration ensures that content changes are automatically built and deployed.
• Customizability: The use of a custom theme and configuration allows for a personalized look and feel for the blog.
Relevant Technologies & Tools
• VitePress: Core static site generator.
• Node.js & NPM: Dependency management and build tools.
• GitHub Actions: Workflow automation for deployment.
• VitePress Theme Components: Vue components (e.g., Layout.vue and ProjectCard.vue) that structure the site’s UI.
• CSS & Fonts: Custom styling files (custom.css, fonts.css) and assets from the assets directory.