Deployment

Deployment Overview

Deploy your Lithos documentation site to production using static site generation.
Properties4
Is BaseNo
Iconi-lucide-upload-cloud
Order1
Tags #deployment #hosting #static-generation

Lithos generates fully static websites that can be hosted anywhere—from GitHub Pages to enterprise CDNs. Static generation provides unbeatable performance, security, and reliability because every page is pre-rendered HTML that requires no server-side processing.

Static Site Benefits
Pre-rendered static sites load instantly, work offline, scale infinitely, and cost pennies to host. You get all the benefits of server-side rendering without the complexity or cost of maintaining servers.

The Generation Process

Static generation starts by crawling your content. Nuxt begins at configured entry points (usually / and key routes like /home), renders each page to HTML, and follows links to discover additional pages. This crawling process ensures all interconnected pages are included even if they're not directly linked from navigation.

During generation, Lithos modules run their transformations:

  • obsidian-transform: Converts wikilinks to proper web links, resolving targets and generating warnings for broken references
  • obsidian-bases: Executes database queries and renders results into static HTML
  • obsidian-graph: Analyzes your vault's link structure and generates the JSON data for graph visualization

Asset optimization happens automatically. Images are compressed and converted to modern formats like WebP. CSS is minified and purged of unused styles. JavaScript bundles are code-split and tree-shaken.

Running the Build

Execute static generation with:

npm run generate

This runs nuxt generate with Docus extensions, producing a fully self-contained site in the .output/public/ directory.

The build process outputs progress information to the terminal, showing which routes are being generated and warning about any issues. Watch for broken wikilinks, missing images, or frontmatter errors.

Output Structure

The .output/public/ directory contains your complete static site:

.output/public/
├── index.html           # Landing page
├── 200.html             # SPA fallback
├── _nuxt/               # Optimized assets (hashed filenames)
│   ├── app.abc123.js
│   └── style.def456.css
├── guide/
│   └── getting-started/
│       └── index.html
└── assets/              # Your vault's static assets
    └── images/

Each content page gets its own subdirectory with an index.html file, creating clean URLs without .html extensions.

Deployment Targets

Choose your hosting platform:

  • GitHub Pages - Free hosting for open-source projects
  • GitLab Pages - CI/CD integrated hosting for GitLab repositories
  • Netlify - One-click deploys with advanced features
  • Vercel - Exceptional performance and developer experience
  • Cloudflare Pages - Global edge network with generous free tier

Advanced Configuration

Base URL for Subdirectory Hosting

When hosting in a subdirectory (like example.com/docs/), configure the base URL:

NUXT_APP_BASE_URL=/docs/ npm run generate

Or add to nuxt.config.ts:

export default defineNuxtConfig({
  app: {
    baseURL: process.env.NUXT_APP_BASE_URL || '/',
  }
})

Pre-rendering Configuration

Control which routes are generated in nuxt.config.ts:

export default defineNuxtConfig({
  nitro: {
    prerender: {
      routes: ['/', '/home', '/about'],
      crawlLinks: true,
      failOnError: false
    }
  }
})

Custom Domains and SSL

All modern hosting platforms provide free SSL certificates via Let's Encrypt. Configure your custom domain in the platform's dashboard, then update DNS records to point to their servers.