Skip to content

Static sites

gspot turns on site for Astro with @astrojs/sitemap, Starlight, VitePress, Docusaurus, Eleventy, or a repository with a sitemap.xml. A scope that depends on a server framework, such as Next.js, stays out. For another static site, run gspot add site, then gspot install.

Before each push, gspot builds the site, then runs these checks:

Check Stage Level What it does
site/build push basic Runs site.build_command, and fails on an error or a missing output folder.
site/html-validate push basic Validates every built page with html-validate.
site/purgecss push basic Finds unused selectors from the scope’s stylesheets in the built CSS.
site/lychee push basic Checks the links between built pages, stylesheets, and fragments without a server or network requests.
site/sitemap push basic Compares the sitemap with the built pages, and reports a listed route with no page or a page left out.
site/unused-assets push basic Finds files under an assets folder that no page, stylesheet, or script names.

Without site.build_command, gspot runs the build script with the package manager of the repository. The build runs in a copy of the tracked files, which also holds the files over repository.max_file_kilobytes, such as a video that a page imports. site.build_folder, the folder of the built files, is dist by default. Set either one when it does not fit your project.

Run gspot check --only site/sitemap,site/lychee to build the site and check its sitemap and internal links. The checks read the built files without starting a server, and the link check makes no network requests.

When your site deploys below a path such as /docs/, gspot reads that path from your sitemap index, and checks links and the sitemap against the built files. Without a sitemap index, gspot assumes the site deploys at /.

site/purgecss reports each selector in the built styles that no built page uses, when the selector also appears in the style sheets or component style blocks of the scope. When a script adds a class at run time, no built page holds it, so the check reports it. List such classes with a reason:

gspot set site.allowed_classes menu-open --reason "The menu script adds it."