Skip to content

Setting up a VuePress 1 site with vuepress-theme-cool

VuePress is a Vue-powered static site generator aimed at documentation: you write Markdown, and it builds a single-page app with a sidebar, search and pre-rendered HTML for each page. vuepress-theme-cool extends the default VuePress 1 theme and adds Markdown-based diagrams (PlantUML, Mermaid), math via KaTeX, sortable/filterable tables (vue-good-table) and charts (Chart.js via vue-chartkick).

This post sets up a minimal site with the theme.

  • Node.js and Yarn 1 (classic). npm works too; swap yarn add -D for npm install -D.

Create a project and install VuePress 1, the theme, and the markdown-it plugins the config below loads:

Terminal window
mkdir vuepress-cool-demo
cd vuepress-cool-demo
yarn init -y
yarn add -D vuepress@1 vuepress-theme-cool markdown-it-katex markdown-it-plantuml markdown-it-admonition

Pin vuepress@1. Older guides (including the theme’s README) say vuepress@next, but that tag now points to VuePress 2, which this theme doesn’t support.

Add scripts to package.json:

{
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
}
}

VuePress looks for its config in <source dir>/.vuepress/config.js. Since the source directory is docs, create docs/.vuepress/config.js:

docs/.vuepress/config.js
module.exports = {
// 'cool' resolves to the vuepress-theme-cool package
theme: 'cool',
markdown: {
extendMarkdown: (md) => {
// allow raw HTML in Markdown
md.set({ html: true });
// $...$ and $$...$$ math
md.use(require('markdown-it-katex'));
// @startuml ... @enduml blocks
md.use(require('markdown-it-plantuml'));
// !!! note ... !!! callouts
md.use(require('markdown-it-admonition'));
},
},
};

The theme includes the KaTeX stylesheet in its layout, so math renders without extra CSS. Mermaid doesn’t need a markdown-it plugin; the theme README shows how to add a small <mermaid> component instead.

Create docs/README.md, which becomes the home page:

# Welcome to my website
This is an example site using [VuePress](https://v1.vuepress.vuejs.org/) and
[vuepress-theme-cool](https://github.com/FriendlyUser/vuepress-theme-cool).
Raw HTML: <span style="color:red">This is red</span>
Math with KaTeX: $E=mc^2$
A PlantUML diagram:
@startuml
Alice -> Bob : hello
@enduml
An admonition from markdown-it-admonition:
!!! note A note
This is the body of the note.
!!!
VuePress's built-in custom container:
::: tip
This is a tip
:::

The ::: tip / ::: warning / ::: danger containers are built into VuePress itself; markdown-it-admonition adds the !!! type Title syntax on top. markdown-it-plantuml turns each @startuml block into an image rendered by a PlantUML server (the public plantuml.com one by default), so diagrams need network access to display.

Terminal window
yarn docs:dev

This starts a dev server at http://localhost:8080/ with hot reload. yarn docs:build writes the static site to docs/.vuepress/dist.

VuePress 1 is built on webpack 4. If the dev server fails on a recent Node.js with ERR_OSSL_EVP_UNSUPPORTED, set NODE_OPTIONS=--openssl-legacy-provider before running it, or use an older Node.js LTS.

© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)