VuePress Documentation

repository·master·Indexed 12 days ago

https://github.com/vuejs/vuepress

A Vue-based Static Site Generator (SSG) designed for creating high-performance, SEO-friendly documentation websites from Markdown. It features a minimalistic doc generator with a Vue component-based layout system, programmatic APIs via @vuepress/core for development and building, and a variety of official plugins for PWA support, search, and analytics.

Tokens
59.8K
Snippets
274
Records
334
Agent score
95%

What's inside VuePress

  1. Introduction to VuePress

    master

    VuePress is a static site generator designed for content-centric websites, specifically optimized for technical documentation. It consists of two main parts:

    1. @vuepress/core: A minimalistic static site generator featuring a Vue-powered theming system and a powerful Plugin API.
    2. Default Theme: A theme optimized for documentation that includes features like responsive layout, search, and customizable navigation.

    Core Behavior:

    • Pre-rendering: Each page is pre-rendered into static HTML for high performance and SEO friendliness.
    • SPA Hydration: Once loaded, Vue takes over the static content, turning the site into a full Single-Page Application (SPA). Subsequent page navigations fetch content on demand.
  2. Overview of @vuepress/plugin-blog features

    master

    The @vuepress/plugin-blog provides several core capabilities for building blog-like structures in VuePress:

    • Classification: A powerful system to quickly classify and organize your posts.
    • Pagination: Built-in support for paginating through your blog posts.
    • Client APIs: Simple APIs designed to make it easier to develop custom blog themes.
  3. Use @vuepress/core for development, building, and ejecting

    master

    The @vuepress/core package provides the primary programmatic APIs for controlling the VuePress lifecycle. You can use these functions to start a development server, generate a production build, or eject the configuration.

    // Example of using the core APIs
    import { dev, build, eject } from '@vuepress/core';
    
    // Start development server
    await dev('./docs', {});
    
    // Build production site
    await build('./docs', {});
    
    // Eject configuration
    await eject('./dist');
  4. VuePress Features Overview

    master

    VuePress provides several built-in capabilities for documentation and customization:

    Markdown Extensions

    • Table of Contents
    • Custom Containers
    • Line Highlighting in code blocks
    • Line Numbers
    • Importing Code Snippets

    Vue in Markdown

    • Templating syntax
    • Using Vue components directly in .md files

    Default Theme Features

    • Responsive layout
    • Optional Homepage configuration
    • Built-in header-based search and Algolia Search support
    • Customizable navbar and sidebar
    • Auto-generated GitHub links and page edit links
    • PWA support (with refresh UI)
    • 'Last Updated' timestamps
    • Multi-language (i18n) support

    Extensibility

    • Plugin API: A powerful system for extending core functionality.
    • Official Plugins: Includes Search, PWA, and Google Analytics plugins.
  5. Use @vuepress/plugin-pwa to enable Progressive Web App support

    master

    The @vuepress/plugin-pwa plugin allows you to transform your VuePress site into a Progressive Web App (PWA). This enables features like offline support, faster loading via service workers, and the ability to install the site on mobile devices or desktops.

    For detailed configuration and setup instructions, refer to the official documentation.

  6. Understand the status of VuePress v1

    master

    VuePress v1 is currently in maintenance mode.

    If you are looking for a next-generation Vue-based Static Site Generator (SSG), consider these alternatives:

    • VitePress: Supported by the official Vue.js team, built on Vue 3 and Vite.
    • VuePress v2+: Community-supported, built on Vue 3 and compatible with Vite, Webpack, or other bundlers.
  7. Use @vuepress/markdown Public API

    master

    The @vuepress/markdown package provides utilities to manage built-in markdown-it plugins within VuePress. It allows you to inspect, remove, or clear all non-essential built-in plugins using the chainMarkdown hook in your VuePress configuration or plugin.

    const { isRequiredPlugin, removePlugin, removeAllBuiltInPlugins } = require('@vuepress/markdown')