vike-vue-content

Prerender the docs site to static files, and handle base when deploying under a subpath.

Deployment

Prerender to a static site

After extending vike-vue-content, each docs entry's +onBeforePrerenderStart.ts automatically enumerates all content paths in its collection and emits HTML page by page. Just turn on prerender in the global config:

// pages/+config.ts
export default {
  prerender: true,
  extends: [vikeVue, vikeVueContent],
}

Then build:

npm run build

The output is plain static files, deployable to any static host (GitHub Pages, Netlify, Vercel, Nginx, etc.).

Deploying under a subpath

If the site isn't at the domain root but under a subpath (e.g. https://example.com/vike-vue-content/), set base in vite.config.ts:

// vite.config.ts
import vue from '@vitejs/plugin-vue'
import vike from 'vike/plugin'
import { defineConfig } from 'vite'

export default defineConfig({
  base: '/vike-vue-content/',
  plugins: [vike(), vue()],
})

With base set, Vite automatically prefixes static assets, but it does not rewrite internal links in Markdown or templates. Use the framework's Link component — it reads the base injected by Vike at runtime and prepends it automatically:

<Link href="/en-US/overview/getting-started">Get Started</Link>
<!-- With base = "/vike-vue-content/", renders as: -->
<!-- <a href="/vike-vue-content/en-US/overview/getting-started">Get Started</a> -->

The base is injected at runtime by Vike via pageContext._baseServer, so the same built component output can be deployed under any subpath without rebuilding.