How bernankez/blog works
Main Components
• Content Repository: The "content" directory holds all the Markdown files for different blog categories (e.g., blog posts, tech articles, stereotyped writings). This acts as the core data source for the blog.
• Static Site Generator (VitePress): The project is powered by VitePress. The ".vitepress" directory contains configuration files (config.ts) and a custom theme (inside .vitepress/theme) which are essential for rendering the site.
• Custom Theme & Components: Two locations house custom UI components:
• The ".vitepress/theme" folder customizes VitePress’s inbuilt theme.
• The "theme" directory contains additional Vue components, layouts, global components, composables, styles, and utilities that enhance and extend the UI and interactivity.
• Build & Configuration: Files like "vite.config.ts", "uno.config.ts", "pnpm-lock.yaml", and package.json define the development environment, build process, and dependency management.
• External Services: Although the core of the system is static, the README references external GitHub Issues for blog comments, adding an integration point for user interaction.
Relationships and Data Flow
• The Markdown content from the "content" directory is processed by VitePress.
• VitePress, guided by its configuration in ".vitepress/config.ts," integrates with the developer-defined theme (both in .vitepress/theme and the "theme" directory) to render pages.
• Vue components defined in the "theme/components" folder (both in common and global directories) are used to build the interactive parts of the site (navigation, search, code previews, etc.).
• Build tools and configuration files orchestrate the transformation process from Markdown to a fully rendered static website.
• The build process triggered by commands (e.g., “pnpm dev”) bundles these components, applying styles (found in "theme/styles") and utility functions (in "theme/utils" and "theme/composables").
Key Architectural Patterns and Design Principles
• Separation of Concerns: Content (Markdown files), presentation (custom themes and Vue components), configuration (VitePress and build tool settings), and external integrations (blog comments) are clearly separated.
• Static Site Generation: The design leverages VitePress for fast, static site generation with reactive Vue components to create a dynamic user experience despite being a static site.
• Customizability & Modular Design: The theme components, composables, and utilities indicate a modular approach to handle UI functionality and site behavior.