V
@vuepress/theme-classic is the theme that used to be the default theme of VuePress. It still works and it keeps its own look, but the new default theme is @vuepress/theme-default, a thin layout layer ported from VitePress. This page maps the options, the frontmatter and the styles of the classic theme to the new theme. Most options were renamed to match VitePress, and the ones that relied on SASS were replaced by CSS custom properties. Update the Package Replace the package of the theme and the…
V
The theme intentionally does not aim at a byte-for-byte copy of the VitePress default theme. This page lists the differences by concern, with the reason for each choice, the benefits and the trade-offs. Migrating from VitePress The theme borrows the layout and the styles of the VitePress default theme, but it is a VuePress theme, so a VitePress site is ported by moving its config and its content into VuePress instead of switching a package. The VitePress documentation and the VuePress guide…
V
The classic theme uses SASS as the CSS pre-processor. Users can customize style variables via a palette file, and add extra styles via a style file. Palette File The path of the palette file is .vuepress/styles/palette.scss. You can make use of it to override predefined SASS variables of the classic theme. Click to expand SASS variables // responsive breakpoints $MQNarrow: 959px !default; $MQMobile: 719px !default; $MQMobileNarrow: 419px !default; Style File The path of the style file is…
V
You can configure the plugins that used by classic theme with themePlugins. Classic theme is using some plugins by default. You can disable a plugin if you really do not want to use it. Make sure you understand what the plugin is for before disabling it. .vuepress/config.ts import { themeClassic } from '@vuepress/theme-classic' export default { theme: themeClassic({ themePlugins: { // customize theme plugins here }, }), } themePlugins activeHeaderLinks boolean Default true Enable…
V
Hint Containers Example 1 (default title): Example 2 (custom title): Code Tabs Tabs
V
These options configure locale-related texts. If your site is served in a different language besides English, you should set these options per locale to provide translations. Options repoLabel string Specify the repository label of your project. This will be used as the text of the repository link, which will be displayed as the last item of the navbar. If you don't set this option explicitly, it will be automatically inferred from the repo option. selectLanguageText string Specify the text of…
V
All Pages Frontmatter in this section will take effect in all types of pages. externalLinkIcon boolean Show external link icon on external links or not. See also: externalLinkIcon navbar boolean Show navbar on this page or not. If you disable navbar in theme config, this frontmatter will not take effect. See also: navbar pageClass string Add extra class name to this page.
V
VuePress classic theme is widely used by users, so it is designed to be extendable, allowing users to make their own customization with ease. Layout Slots Classic theme's Layout provides some slots: navbar navbar-before navbar-after sidebar sidebar-top sidebar-bottom page page-top page-bottom page-content-top page-content-bottom With the help of them, you can add or replace content easily. Here comes an example to introduce how to extend classic theme with layout slots. Create a client config…
V
Basic Config hostname string Hostname to be deployed, e.g.: https://example.com locales { [path: string]: Partial<ClassicThemeLocaleData> } Default {} Specify locales for i18n support. All the options inside the Locale Config section can be used in locales. This option will only take effect in classic theme, so don't confuse with locales in Site Config. See also: Guide > I18n Locale Config Config of this section can be used as normal config, and can also be used in the locales option. colorMode…
V
Badge type 'tip' | 'warning' | 'danger' | 'important' | 'info' | 'note' Default 'tip' The type of the badge. text string Default '' The text of the badge. vertical 'top' | 'middle' | 'bottom' Default undefined The vertical align of the badge.
V
Usage Install @vuepress/theme-classic : npm install @vuepress/theme-classic@next .vuepress/config.ts import { themeClassic } from '@vuepress/theme-classic' export default { theme: themeClassic({ // set theme config here }), }
V
Add the raw container to your VuePress site, with optional style isolation for its content. Usage npm i -D @vuepress/plugin-markdown-raw@next .vuepress/config.ts import { markdownRawPlugin } from '@vuepress/plugin-markdown-raw' export default { plugins: [markdownRawPlugin()], } Guide raw container The raw container wraps its content with a <div class="vp-raw"> element. It is meant for content that is rendered by another tool or copied from a component library, whose DOM is not expected to…
V
Add share buttons to your site, so visitors can share pages to social platforms, by email, or as a QR code. Usage npm i -D @vuepress/plugin-share@next .vuepress/config.ts import { sharePlugin } from '@vuepress/plugin-share' export default { plugins: [ sharePlugin({ // options }), ], } The plugin registers a global Share component. Add it to any page: <Share /> Guide Share Services By default, the plugin renders buttons for X (formerly Twitter), Facebook, Reddit, Telegram, WhatsApp, and email.…
V
A powerful client-side search plugin featuring custom indexing and full-text search support, powered by FlexSearch. Usage npm i -D @vuepress/plugin-flexsearch@next .vuepress/config.ts import { flexsearchPlugin } from '@vuepress/plugin-flexsearch' export default { plugins: [ flexsearchPlugin({ // options }), ], } Guide Search Index Powered by FlexSearch, this plugin provides fast search capabilities, even for large documentation sites. By default, the plugin indexes only headings, article…
V
Unit testing utilities for VuePress. vuepress/client imports generated modules (@internal/*) and compile-time defines (__VUEPRESS_DEV__, ...) at module scope, so it cannot be imported in a unit test. This package replaces them, so that the client code of a plugin or a theme can be rendered and interacted with in a unit test, instead of running the heavy e2e tests. Usage npm i -D @vuepress/test-utils@next @vue/test-utils happy-dom vitest vitest.config.ts import { vuepressTestPlugin } from…
V
auto Based on theme mode.
V
Add presentation in your VuePress site via Reveal.js. Usage npm i -D @vuepress/plugin-revealjs@next .vuepress/config.js import { revealJsPlugin } from '@vuepress/plugin-revealjs' export default { plugins: [ revealJsPlugin({ // plugin options }), ], } Slide Syntax Use `
V
Add PlantUML support to the Markdown files in your VuePress site. Installation You can enable this feature via: .vuepress/config.ts import { markdownChartPlugin } from '@vuepress/plugin-markdown-chart' export default { plugins: [ markdownChartPlugin({ // Enable PlantUML plantuml: true, }), ], } Syntax You can insert the same content that plantuml supports, for example: @startuml content @enduml Demo
V
Let the Markdown files in your VuePress site support Mermaid. Installation Install Mermaid in your project: Then enable it via: .vuepress/config.ts import { markdownChartPlugin } from '@vuepress/plugin-markdown-chart' export default { plugins: [ markdownChartPlugin({ // Enable Mermaid mermaid: true, }), ], } Syntax ```mermaid <!-- Your mermaid code here. --> ``` Besides using mermaid, you can also use the following code blocks: block: block class: classDiagram c4c: C4Context er: erDiagram…
V
Add Markmap support to the Markdown files in your VuePress site. Installation Install @markmap/parse, @markmap/toolbar and @markmap/view in your project: To render TeX math in labels, also install @markmap/plugin-math and @markmap/render: Then enable it via: .vuepress/config.ts import { markdownChartPlugin } from '@vuepress/plugin-markdown-chart' export default { plugins: [ markdownChartPlugin({ // Enable Markmap markmap: true, }), ], } Syntax ```markmap <!-- contents here --> ``` Configuring…
V
Add flowchart support to the Markdown files in your VuePress site. Installation Install flowchart.ts in your project: Then enable it via: .vuepress/config.ts import { markdownChartPlugin } from '@vuepress/plugin-markdown-chart' export default { plugins: [ markdownChartPlugin({ // Enable Flowchart flowchart: true, }), ], } Syntax <!-- ↓ :preset is optional --> ```flow:preset <!-- Your flowchart code here. --> ``` Available presets for now: vue (default) ant pie Demo Flowchart Intro Node Types…
V
Add ECharts support to the Markdown files in your VuePress site. Installation Install ECharts in your project: Then enable it via: .vuepress/config.ts import { markdownChartPlugin } from '@vuepress/plugin-markdown-chart' export default { plugins: [ markdownChartPlugin({ // Enable ECharts echarts: true, }), ], } Syntax With JSON If you can generate your chart data easily, you can just provide echarts config using JSON code block: ::: echarts Title ```json { // Your echarts config here. } ``` :::…
V
Add Chart.js support to the Markdown files in your VuePress site. Installation Install Chart.js in your project: Then enable it via: .vuepress/config.ts import { markdownChartPlugin } from '@vuepress/plugin-markdown-chart' export default { plugins: [ markdownChartPlugin({ // Enable Chart.js chartjs: true, }), ], } Syntax ::: chartjs Chart Title ```json { // Your chart configuration here } ``` ::: You should use json code block to provide your Chart.js configuration whenever possible, however…
V
Add powerful charts to your VuePress site. This plugin provides 6 different chart libraries to help you insert charts into your Markdown files: Chart.js: A lightweight, easy-to-use, highly customizable chart library. Chart.js is lighter compared to ECharts. ECharts: A powerful, interactive charting and visualization library for browsers. ECharts is more powerful compared to Chart.js. Flowchart: A simple Markdown extension to generate flowcharts and sequence diagrams. Lightweight, focusing only…
V
A concise, safe and free comment system for static sites, based on Tencent Cloud Development. Usage npm i -D twikoo Set provider: "Twikoo" and pass your server address to the envId option: .vuepress/config.ts import { commentPlugin } from '@vuepress/plugin-comment' export default { plugins: [ commentPlugin({ provider: 'Twikoo', envId: 'https://twikoo.example.com', }), ], } Deploy Backend Deploy the backend according to the official documentation. Tips The plugin automatically sets lang (to…
V
Configuration The plugin offers flexible configuration through both the plugin options and the client configuration file. Using Plugin Options .vuepress/config.ts import { commentPlugin } from '@vuepress/plugin-comment' export default { plugins: [ commentPlugin({ provider: 'Artalk', // Artalk | Giscus | Waline | Twikoo // provider-specific options }), ], } Using Client Config .vuepress/client.ts import { defineArtalkConfig, // defineGiscusConfig, // defineTwikooConfig, // defineWalineConfig, }…
V
Giscus is a commenting system based on GitHub Discussions that is easy to set up. Usage Set provider: "Giscus" and pass the values obtained from the Giscus page to the repo, repoId, category and categoryId options: .vuepress/config.ts import { commentPlugin } from '@vuepress/plugin-comment' export default { plugins: [ commentPlugin({ provider: 'Giscus', repo: 'owner/repo', repoId: 'repo-id', category: 'Announcements', categoryId: 'category-id', }), ], } Preparation Create a public repository…
V
Artalk is a clean self-hosted commenting system that you can easily deploy on your server and integrate into your front-end pages. Deploy the Artalk comment box on your blog or any other page to add rich social functionality. Usage npm i -D artalk Set provider: "Artalk" and pass your server address to the server option: .vuepress/config.ts import { commentPlugin } from '@vuepress/plugin-comment' export default { plugins: [ commentPlugin({ provider: 'Artalk', server:…