Sitemax — User Documentation

Quick Start

Get up and running with Sitemax in 3 steps:


# 1. Install
pnpm add -D sitemax-plugin
# or
npm i -D sitemax-plugin

# 2. Add to vite.config.js
import { defineConfig } from 'vite'
import sitemaxPlugin from 'sitemax-plugin'

export default defineConfig({
  base: '/my-site/',
  plugins: [sitemaxPlugin({ siteUrl: 'https://username.github.io/my-site' })],
})

# 3. Build
pnpm build

Installation

Install the plugin with your package manager:


pnpm add -D sitemax-plugin
# or
npm i -D sitemax-plugin
Note: Normal users should install from npm. Contributors can use the local plugin file as in this repository.

Usage (Vite)

Minimal vite.config.js example:


import { defineConfig } from 'vite';
import sitemaxPlugin from 'sitemax-plugin';

export default defineConfig({
  base: '/your-base/',
  plugins: [
    sitemaxPlugin({
      siteUrl: 'https://your-site.example',
      generateRobots: true,
      meta: {
        title: 'Site title',
        description: 'Site description',
        ogImage: '/og-image.png'
      }
    })
  ]
});

Configuration

  • siteUrl — public root URL used for absolute sitemap URLs
  • generateRobots — include robots.txt when true
  • meta — default meta title/description/ogImage for test checks

How it works

On build the plugin collects your built HTML files, normalizes routes and writes sitemap.xml and optionally robots.txt to the dist folder. The CI workflow can copy those to public/ and deploy to GitHub Pages.

Troubleshooting

  1. Ensure siteUrl matches your published Pages URL (including subpath).
  2. Verify GitHub Pages is configured to serve the gh-pages branch (root).
  3. Use CI Debug steps to inspect dist/ and gh-pages if files are missing.
⚠️ Common pitfall: forgetting the base option in vite.config.js when deploying to GitHub Pages.