Quick answer
VitePress is a static site generator from the Vue team that turns Markdown files into a fast documentation site, with search, a sidebar, and navigation built in. You write pages in Markdown, VitePress builds plain HTML, and you host the result anywhere that serves static files. This post installs VitePress 1.6.4 and builds a help site for a Karachi clothing shop, showing what happens when a link points at a missing page.
A clothing shop in Karachi answers the same three questions all day: how to order, how long delivery takes, and whether I can return this. The answers live in staff members' heads and scattered WhatsApp messages, so every new hire answers differently and every customer waits for a reply. A docs site fixes that, but only if someone actually builds it, and a heavy setup guarantees it never gets built. The shop needs pages it can edit in Markdown, a sidebar to organise them, and a build that catches broken links before customers do. That is the job VitePress does.
What I would check before using it
My first check: is the site documentation or a shop front? VitePress is built for docs, with no shop features. If the site needs a cart, checkout, or product listings, a general site builder fits better, as the Eleventy Static Site Tutorial: Build a Fast Shop Site post shows. VitePress fits when the content is guides and answers, not products.
My second check: who writes the pages? VitePress pages are Markdown files in a folder, edited in a text editor and tracked in git. That suits a team that already lives in git, but not a shop owner who wants to edit pages in a browser, as a CMS allows. The MkDocs Tutorial: Turn Markdown Into a Real Docs Site post covers a Python-based alternative built on the same idea, so compare the two before committing.
My third check: how much custom design the docs need? Out of the box, VitePress looks like VitePress, clean and familiar, which suits help pages. Deep customisation means writing Vue components, so with no Vue on the team, the default theme is what you ship. That should be a conscious choice, not a surprise.
My fourth check: what the docs grow into? VitePress has no built-in versioning or blog, unlike Docusaurus, which the Docusaurus Tutorial: Docs Your Shop Can Actually Ship post covers. If the shop will keep several versions of its guides live, Docusaurus saves pain.
My verdict, as judgement: use VitePress when one team writes Markdown guides, the default theme is acceptable, and the site stays docs-only. It flips for a shop front, a browser editor, or versioned docs.
A Karachi clothing shop, documented with VitePress
The demo is the Karachi clothing shop from the intro: home, ordering, delivery, returns, and shipping rates.
Install VitePress in an empty folder. Node v24.22.1 and npm 10.9.4 were installed already; the install added 125 packages:
$ npm init -y $ npm install vitepress added 125 packages in 39s $ node -e "console.log('vitepress:', require('vitepress/package.json').version)" vitepress: 1.6.4 Settings live in docs/.vitepress/config.mjs. The sidebar lists the help pages, including /shipping, a page I had not written yet:
export default { title: 'Karachi Clothing Shop Docs', description: 'Ordering, delivery, and returns for the Karachi clothing shop', themeConfig: { nav: [ { text: 'Home', link: '/' }, { text: 'Ordering', link: '/ordering' } ], sidebar: [ { text: 'Shop help', items: [ { text: 'Ordering', link: '/ordering' }, { text: 'Delivery', link: '/delivery' }, { text: 'Returns', link: '/returns' }, { text: 'Shipping rates', link: '/shipping' } ] } ] } } The pages are plain Markdown; the ordering page lists sizes and payment options:
# Ordering Order in three steps: pick a size from the size chart, send your order on WhatsApp, and pay cash on delivery. ## Sizes | Size | Chest (inches) | Length (inches) | | ---- | -------------- | --------------- | | S | 38 | 27 | | M | 40 | 28 | | L | 42 | 29 | | XL | 44 | 30 | ## Payment Cash on delivery is available in Karachi, Lahore, and Islamabad. Orders outside these cities are paid in advance through bank transfer or JazzCash. The delivery and returns pages follow the same shape. Build the site:
$ npx vitepress build docs vitepress v1.6.4 - building client + server bundles... ✓ building client + server bundles... - rendering pages... ✓ rendering pages... build complete in 7.15s. The first build passed, but the sidebar still pointed at /shipping, a page that did not exist, and VitePress said nothing. Only links inside pages are checked, not sidebar links. I added a shipping link inside the ordering page, and the build failed:
$ npx vitepress build docs vitepress v1.6.4 - building client + server bundles... (!) Found dead link /shipping in file ordering.md If this is expected, you can disable this check via config. Refer: https://vitepress.dev/reference/site-config#ignoredeadlinks x Build failed in 11.13s ✖ building client + server bundles... build error: [vitepress] 1 dead link(s) found. [vitepress] 1 dead link(s) found. The message names the file and the link, so the fix is clear: write the missing page. I created docs/shipping.md, and the rebuild passed:
$ npx vitepress build docs vitepress v1.6.4 - building client + server bundles... ✓ building client + server bundles... - rendering pages... ✓ rendering pages... build complete in 18.40s. The build output is plain files. Check the pages exist:
$ find docs/.vitepress/dist -name "*.html" | sort docs/.vitepress/dist/404.html docs/.vitepress/dist/delivery.html docs/.vitepress/dist/index.html docs/.vitepress/dist/ordering.html docs/.vitepress/dist/returns.html docs/.vitepress/dist/shipping.html Then serve the built site and fetch a page, as a visitor would:
$ npx vitepress preview docs --port 4173 Built site served at http://localhost:4173/ $ curl -s -o /dev/null -w "ordering: HTTP %{http_code}\n" http://localhost:4173/ordering.html ordering: HTTP 200 $ curl -s http://localhost:4173/ordering.html | grep -o -m1 "<title>[^<]*</title>" <title>Ordering | Karachi Clothing Shop Docs</title> $ curl -s http://localhost:4173/ordering.html | grep -c "Cash on delivery" 1 The ordering page answers HTTP 200, its title reads "Ordering | Karachi Clothing Shop Docs", and "Cash on delivery" is in the page. Home and shipping answer 200 as well. The dead link to a 404 is caught first.
Common mistakes and how to fix them
First, a dead link inside a page. The symptom is the build failing with (!) Found dead link /shipping in file ordering.md and [vitepress] 1 dead link(s) found. The fix: create the missing page or remove the link, then rebuild.
Second, a dead link in the sidebar. The symptom is nothing at all: the build passes, as this run proved, because VitePress does not check sidebar links. The fix: check sidebar links by hand, or link to the page from another page too, which the build does check.
Third, previewing before building. The symptom is failed to start server. error: ENOENT: no such file or directory, open '.../docs/.vitepress/dist/404.html'. The fix: run npx vitepress build docs first. Preview serves the dist folder, and there is nothing to serve until the build runs.
Fourth, building the wrong folder. The symptom is a build that reports success but produces an empty site: only a 404 page and assets, no content pages. VitePress exits 0 even when the folder does not exist, as this run showed. The fix: list the dist files after every build and confirm your pages are there.
Frequently Asked Questions
Do I need to know Vue to use VitePress? No. Pages are Markdown only, and the default theme needs no Vue. Vue matters only for custom theme components.
Is VitePress free? Yes, it is open source under the MIT licence, built by the Vue team. Hosting still costs, but the built site is static files, so a cheap static host works.
How is VitePress different from Docusaurus? VitePress is Vue-based and lighter, with no built-in versioning or blog. Docusaurus is React-based and ships versioning, a blog, and translations, as the Docusaurus Tutorial: Docs Your Shop Can Actually Ship post shows. Pick VitePress for a small docs site, Docusaurus for the extras.
Can I host the built site anywhere? Yes. The dist folder is plain HTML, CSS, and JavaScript, so any static host works.
Why did my sidebar link not break the build? VitePress checks links inside pages, not sidebar links. Link to the page from another page, or verify sidebar links by hand.
What to remember
- Markdown in, static HTML out: dist is the whole site.
- Config lives at docs/.vitepress/config.mjs, sidebar in themeConfig.
- Dead links in pages fail the build; sidebar links are not checked.
- A build that exits 0 can still be empty: list the dist files.
- Preview locally and fetch a page before deploying.
Where this leaves you
The shop now has a help site it can keep: five pages in Markdown, a sidebar that organises them, and a build that refuses to ship a dead link inside a page. The surprise was the sidebar link that passed silently. Trust the build for page links, and check the navigation yourself. Take one set of answers your team repeats all day, write them as Markdown pages, and let VitePress turn them into a site customers can read without waiting.
Further reading
- VitePress: What is VitePress?
- VitePress: Getting started
- VitePress site config: ignoreDeadLinks
- Vue: Introduction
- Docusaurus Tutorial: Docs Your Shop Can Actually Ship
- MkDocs Tutorial: Turn Markdown Into a Real Docs Site
- Eleventy Static Site Tutorial: Build a Fast Shop Site
- Hugo Explained: Blazing-Fast Static Sites From Go
- Astro Explained: Websites That Ship Less JavaScript
Waqas Shahid is a software engineer from Karachi with more than 12 years of experience, including 6+ years in engineering leadership. He writes The Practical Developer.
Originally published at https://practicaldevblog.blogspot.com/2026/12/vitepress-docs-site-tutorial.html
