Skip to main content

Versioned static-site deployments with builder isolation

Project description

versite

versite is a generic versioned static-site deployment tool inspired by mike, but it is not coupled to MkDocs. It manages a deployment branch containing multiple published site versions, aliases, redirects, and per-version metadata. Only versite deploy is allowed to invoke a site builder.

Why it exists

mike is tightly centered on MkDocs. versite separates the problem into two layers:

  1. A versioned static-site manager that edits versions.json, alias paths, redirects, and the target git branch.
  2. A command-based builder runner that invokes builders as external subprocesses only during deploy.

That separation means non-build commands stay fast and reliable:

  • versite list
  • versite delete
  • versite alias
  • versite retitle
  • versite props
  • versite set-default
  • versite serve

Those commands do not import MkDocs, load MkDocs config, run MkDocs plugin hooks, invoke Jekyll, or shell out to any builder.

Installation

pip install -e .
versite --help

Configuration

versite reads versite.yml if present. The config loader only uses lightweight YAML parsing.

builder: mkdocs
remote: origin
branch: gh-pages
deploy_prefix: ""
alias_type: redirect
redirect_template: null
push: false

builders:
  mkdocs:
    command:
      - mkdocs
      - build
      - --clean
      - --config-file
      - "{config_file}"
      - --site-dir
      - "{output_dir}"
    config_file: mkdocs.yml

  jekyll:
    command:
      - bundle
      - exec
      - jekyll
      - build
      - --source
      - "{source}"
      - --destination
      - "{output_dir}"
    source: .

CLI flags override config values.

MkDocs usage

MkDocs support is implemented only as a command template. versite never imports mkdocs.

versite deploy 1.0 latest --builder mkdocs
versite list
versite set-default latest
versite delete 0.9

During deploy, the MkDocs builder receives:

  • VERSITE_VERSION=<version>
  • MIKE_DOCS_VERSION=<version>

Jekyll usage

Jekyll support is also command-template based.

versite deploy 1.0 latest --builder jekyll
versite list
versite alias 1.0 stable
versite set-default latest

versite does not import Jekyll-related Python libraries. It only runs the configured command during deploy.

Custom builders

Custom builders can be added through versite.yml without changing Python code:

builder: custom

builders:
  custom:
    command:
      - npm
      - run
      - build
      - --
      - --outDir
      - "{output_dir}"

Example:

versite deploy 1.0 latest --builder custom

Command reference

versite deploy VERSION [ALIAS...]
versite list [IDENTIFIER]
versite delete [IDENTIFIER...] [--all]
versite alias IDENTIFIER [ALIAS...]
versite retitle IDENTIFIER TITLE
versite props IDENTIFIER [PROP]
versite set-default IDENTIFIER
versite serve

Important options:

  • --config-file FILE
  • --builder NAME
  • -r, --remote REMOTE
  • -b, --branch BRANCH
  • -m, --message MESSAGE
  • -p, --push
  • --allow-empty
  • --deploy-prefix PATH
  • --alias-type {redirect,copy,symlink}
  • -T, --template FILE
  • --ignore-remote-status
  • --source DIR
  • --output-dir DIR
  • --build-command ...
  • -q, --quiet
  • --json

Alias modes

  • redirect: writes static HTML redirects. This is the default and works well on GitHub Pages.
  • copy: copies the deployed version directory into each alias directory.
  • symlink: creates symlink aliases in the target branch for compatibility-focused setups.

GitHub Pages

versite is designed for branch-based static hosting. A common setup is gh-pages with redirect aliases and a root index.html redirect created by set-default.

Example MkDocs config:

builder: mkdocs
branch: gh-pages
alias_type: redirect

builders:
  mkdocs:
    command:
      - mkdocs
      - build
      - --clean
      - --config-file
      - "{config_file}"
      - --site-dir
      - "{output_dir}"
    config_file: mkdocs.yml

Example Jekyll config:

builder: jekyll
branch: gh-pages
alias_type: redirect

builders:
  jekyll:
    command:
      - bundle
      - exec
      - jekyll
      - build
      - --source
      - "{source}"
      - --destination
      - "{output_dir}"
    source: .

Migration from mike

  • mike deploy roughly maps to versite deploy --builder mkdocs.
  • mike list, delete, alias, retitle, props, and set-default roughly map to the same versite subcommands.
  • Unlike mike, non-build commands do not load MkDocs config.
  • Shared deployment settings should move into versite.yml.
  • VERSITE_VERSION is the generic build env var. MkDocs builders also receive MIKE_DOCS_VERSION for compatibility.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

versite-0.0.1.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

versite-0.0.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file versite-0.0.1.tar.gz.

File metadata

  • Download URL: versite-0.0.1.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for versite-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f3010706d79e8cc10a98fde7948189abe203bebf43ee87751502c94b54e59db1
MD5 3f6d134f4140862e24195ac2142b62e5
BLAKE2b-256 b85c09bee2b78b4d10370663bfda6521aaaf0f6f00d45525d03216eaf76ee1d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for versite-0.0.1.tar.gz:

Publisher: release.yml on PrimerPages/versite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file versite-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: versite-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for versite-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 45ee0a778c77aa408b9dfd51a01ab1d3c67fe0ad5fd32c21ed975c8243f2acaa
MD5 f78560d944e05b26d14469052c090deb
BLAKE2b-256 a43e4b6665ddcdb6bc5c0ef682fbface5d8fbc050b9272071c91ec854e749d91

See more details on using hashes here.

Provenance

The following attestation bundles were made for versite-0.0.1-py3-none-any.whl:

Publisher: release.yml on PrimerPages/versite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page