VitePress is a popular static site generation library, especially for technical documentation.Β With Pintheon, it's easy to deploy you VitePress docs to the internet.
Video Walkthrough β
Prerequisites β
Install these packages:
npm install dotenv --save npm install --save-dev @types/node
Process β
First step is to create you VitePress site, this tutorial isn't about how to use VitePress, to follow the docs for to understand fully how to use the library.
In this case we will be scaffolding a very basic site.
Scaffold the Site β
Open a terminal in the directory in which you want your project files to exist, then run:
npx vitepress init
VitePress will give you a set of interactive prompts that act as a basis for the site setup.
β Welcome to VitePress!
β
β Where should VitePress initialize the config?
β ./docs
β
β Where should VitePress look for your markdown files?
β ./docs
β
β Site title:
β My Awesome Project
β
β Site description:
β A VitePress Site
β
β Theme:
β Default Theme
β
β Use TypeScript for config and theme files?
β Yes
β
β Add VitePress npm scripts to package.json?
β Yes
β
β Add a prefix for VitePress npm scripts?
β Yes
β
β Prefix for VitePress npm scripts:
β docs
β
β Done! Now run pnpm run docs:dev and start writing.
Site Files β

config.mts β
This file configures the site. This file needs to be updated so that it works when uploaded to your Pintheon node.
We will update it, adding an environment variable, so routing is consistent for development, and when built for deplyment on Pintheon. We add these lines to the config:
// Base URL configuration - will be available as import.meta.env.BASE_URL
base: process.env.NODE_ENV === 'production' ? '/home/' : '/',
// Ensure Vite knows about our base URL
vite: {
define: {
'import.meta.env.BASE_URL': JSON.stringify(process.env.NODE_ENV === 'production' ? '/home/' : '/')
}
}
So the config now looks like this:
import { defineConfig } from 'vitepress'
// https://vitepress.dev/reference/site-config
export default defineConfig({
// Base URL configuration - will be available as import.meta.env.BASE_URL
base: process.env.NODE_ENV === 'production' ? '/home/' : '/',
// Ensure Vite knows about our base URL
vite: {
define: {
'import.meta.env.BASE_URL': JSON.stringify(process.env.NODE_ENV === 'production' ? '/home/' : '/')
}
},
title: "Pintheon Demo",
description: "A Pintheon Demo",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Examples', link: '/markdown-examples' }
],
sidebar: [
{
text: 'Examples',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' }
]
}
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
]
}
})
package.json β

This file defines the dependencies, as well as settings for building the project. We want to update it to include the 'NODE_ENV' environment variable we defined above:
{
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "NODE_ENV=production vitepress build",
"docs:preview": "vitepress preview"
},
"dependencies": {
"dotenv": "^17.2.3"
},
"devDependencies": {
"@types/node": "^24.6.2"
}
}
This is specifically so the routing works in the built app. To build and run for development we call:
npm run docs:dev
The site will be built and runs on: http://localhost:5173/
markdown files β

The markdown files are used for the site content, customize these, add more etc., in order to customize the site content.
Deploying to Pintheon β
First build the site with:
npm run docs:build
Β

All the built assets are built into the /dist directory
Β

We want to compress these into a zip file so we can upload them to the Pintheon node.
Uploading zip to Pintheon
β
Log into your Pintheon node, and navigate to Settings. Under 'Homepage', choose 'Upload' from the drop-down.
Β

Then press the upload button and find the zipped site assets.

If upload was successful, a confirmation will show.
Β

The site is now served on: https://127.0.0.1:9998/home/
Β

Log into your pinggy acccount, and copy your token.
Set your Pinggy token in Metavinci.
Β

By default metavinci assumes tunnels will use pinggy pro, if you want to use pinggy free, you must set it in metavinci.
Serving your site to the Internet β

Open a tunnel with metavinci
Β

The Pinggy terminal will popup, and showing the links to where you site is being served on the internet.
That's it!Β You now have a custom website served to the web, directly from your computer.
Β