Valaxy Static Blog Framework

repository·main·Indexed 11 days ago

https://github.com/YunYouJun/valaxy

A high-performance static blog generator powered by Vue 3 and Vite. Valaxy features hot reloading, file-based routing, and a flexible addon system. It includes tools for theme development via valaxy-theme-starter, project scaffolding with create-valaxy, and various official addons for Algolia, Feishu, and more. Version 1.0.0-rc.5.

Tokens
141.1K
Snippets
534
Records
697
Agent score
69%

What's inside Valaxy

  1. Overview of Valaxy features

    main

    Valaxy is a next-generation static blog framework (Beta) built with modern web technologies. Key features include:

    • Core Stack: Powered by Vue 3, Vite 8, pnpm, and Rolldown for high performance.
    • Developer Experience: Supports hot reloading for both configuration (valaxy.config.ts) and Markdown files. All configuration options in valaxy.config.ts include type hints.
    • Routing & Components: Implements file-based routing via vue-router and automatic component importing via unplugin-vue-components.
    • Content & Styling: Supports extending Markdown Frontmatter, uses UnoCSS for Tailwind CSS-like styling, and allows using icons from collections via CSS classes (via unplugin-icons).
    • Static Site Generation (SSG): Uses vite-ssg to generate static sites, while also supporting Single Page Applications (SPA).
    • Extensibility: Supports any Vite plugin (e.g., vite-plugin-pwa for PWA support) and features a Layout system for theme extension.
    • Deployment: Offers zero-config deployment options for Netlify (via netlify.toml) and GitHub Pages (via GitHub Actions).
  2. Discover Valaxy addons via the Addons Gallery

    main

    The Valaxy Addons Gallery provides a centralized view of both official and community-maintained addons.

    • Official Addons: Packages maintained within the Valaxy monorepo. You can find detailed guides for these in the Official Addons section.
    • Community Addons: Third-party extensions developed by the community to extend Valaxy's functionality.
  3. Explore Official Valaxy Addons

    main

    Valaxy provides a suite of official addons maintained within the monorepo to extend functionality. You can find documentation for each specific addon in the official addon index. These addons cover various features such as search, media integration, and comments.

    Available Official Addons:

    • valaxy-addon-abbrlink: Abbreviation linking.
    • valaxy-addon-algolia: Algolia search integration.
    • valaxy-addon-bangumi: Bangumi integration.
    • valaxy-addon-components: Component-related features.
    • valaxy-addon-feishu: Feishu integration.
    • valaxy-addon-girls: Girls integration.
    • valaxy-addon-lightgallery: Lightgallery integration.
    • valaxy-addon-meting: Meting integration.
    • valaxy-addon-twikoo: Twikoo comments integration.
    • valaxy-addon-waline: Waline comments integration.

    For community-maintained packages, refer to the Addon Gallery.

  4. What is Valaxy and its core architecture

    main

    Valaxy is a next-generation static blogging framework built on Vue and Vite.

    Unlike traditional static site generators (SSGs) that treat every page as an independent island (like Astro), Valaxy uses a single-page SSG architecture.

    How it works:

    1. It generates a separate HTML file for each blog page to ensure SEO and initial load capability.
    2. Once a user enters from any entry point, the site activates as a Single Page Application (SPA).
    3. When navigating between pages, Valaxy only updates the necessary page content and scripts without a full browser reload, providing a smooth, SPA-like user experience.

    This architecture offers a trade-off: while the initial first-screen loading speed might be slightly slower than pure island-based architectures, the experience during page transitions is significantly more fluid.

  5. Handle SSR and Hydration Mismatches in Valaxy

    main

    Valaxy uses Static Site Generation (SSG), meaning components run in a Node.js environment during build time where browser APIs like window, document, and navigator are unavailable.

    Hydration mismatches occur when the HTML generated during SSG differs from the HTML rendered in the browser. Common causes include:

    • Using browser-only APIs in templates (e.g., {{ window.innerWidth }}).
    • Using time or locale-dependent values (e.g., new Date().toLocaleString()).
    • Non-standard HTML nesting (e.g., <div> inside <p>).
    • Browser extensions modifying the DOM.

    To prevent these issues, use the patterns described in the following records.

  6. Organize multi-language documentation in Valaxy

    main

    Valaxy uses a path-based separation approach to organize documentation in different languages. To maintain a bilingual site, follow this directory structure:

    • English documentation: Located in /docs/pages/
    • Chinese documentation: Located in /docs/pages/zh/

    Example mapping:

    • English: docs/pages/guide/getting-started.md
    • Chinese: docs/pages/zh/guide/getting-started.md
  7. How prop priority works in valaxy-addon-meting

    main

    When configuring music resources, props are resolved in the following order (from highest to lowest priority):

    1. Component props: Passed directly to the <MetingJs> component in a template.
    2. Addon props config: Defined in the addonMeting({ props: { ... } }) configuration.
    3. Built-in defaults: The default values provided by MetingJS.