Documentation for Bactopia, built with Docusaurus 3.
- Node.js >= 18
- Conda environment
bactopia-devfrom the bactopia repo (provides Node.js, Python, and all shared dependencies)
# Create the environment (from the bactopia repo)cd /path/to/bactopia
conda env create -f environment.yml -n bactopia-dev
conda activate bactopia-devgit clone git@github.com:bactopia/bactopia.github.io.git
cd bactopia.github.io
npm install
npm startThe dev server runs at http://0.0.0.0:8000 with hot reload.
| Script | Description |
|---|---|
npm start | Start the dev server with hot reload |
npm run build | Production build to build/ |
npm run serve | Serve the production build locally |
npm run clear | Clear the Docusaurus cache |
npm run typecheck | Run TypeScript type checking |
Most documentation under bactopia-tools/, bactopia-pipelines/, developers/, and impact/ is auto-generated from the bactopia source repo using Python scripts in bin/.
# Generate all docs (requires bactopia repo path)
make generate BACTOPIA_REPO=/path/to/bactopiaIndividual targets are also available:
| Target | Description |
|---|---|
parse | Parse the bactopia repo into data/bactopia.json |
generate-workflows | Generate tool and pipeline docs |
generate-subworkflows | Generate subworkflow docs |
generate-modules | Generate module docs |
generate-citations | Generate citations page |
generate-acknowledgements | Generate acknowledgements page |
generate-enhancements | Generate enhancements page |
parse-cli | Parse bactopia-py CLI into data/cli.json |
generate-cli | Generate CLI reference docs |
update-citations | Refresh data/citations.yml from source |
clean-generated | Remove all generated files |
By default, parse-cli uses the Python from bactopia-dev. Override with:
make parse-cli BACTOPIA_DEV_PYTHON=/path/to/pythondocs/ Main Bactopia documentation
bactopia-tools/ Auto-generated tool docs
bactopia-pipelines/ Auto-generated pipeline docs
developers/ Developer guides, subworkflows, modules, CLI reference
impact/ Impact & outreach content
blog/ Blog posts
data/ JSON/YAML data files (citations, CLI, bactopia metadata)
src/ React components, custom CSS, pages
bin/ Python doc-generation scripts
templates/ Jinja2 templates for doc generation
static/ Static assets (images, logos)
The site uses 5 Docusaurus docs plugins, so native versioning (which only supports the default plugin) is not used. Instead, each release is preserved as a static build snapshot stored in an orphan git branch (snapshot/vX.Y.Z). The deploy workflow assembles active snapshots into the build output at deploy time.
/-- always serves the current version/vX.Y.Z/-- serves active version snapshots (with an announcement banner linking to latest)snapshots.json-- registry of all versions; theactiveflag controls which are included in the deploy- Cloudflare Pages free plan has a 20,000 file limit; each snapshot uses ~2,000 files
- Go to Actions > Create Version Snapshot and run the workflow
version: the version tag (e.g.,v4.0.0)bactopia_ref: the bactopia repo ref to build from (e.g.,v4.0.0)
- The workflow builds the site with a version banner, pushes an orphan branch
snapshot/vX.Y.Z, and updatessnapshots.jsonon master - The deploy workflow runs automatically, including the new snapshot
After creating the snapshot, update the version label in docusaurus.config.ts to the new version:
versions: {current: {label: 'v4.1.0',// update to new version
...
},},Re-run the Create Version Snapshot workflow with the same version. The orphan branch is force-pushed with the new build.
make snapshot-list # show all versions and file budget
make snapshot-add VERSION=vX.Y.Z FILES=N # manually register a snapshot
make snapshot-deactivate VERSION=v2.1.0 # drop from active deploy
make snapshot-activate VERSION=v2.1.0 # restore to active deployDeactivated versions appear under "Archived Versions" in the dropdown, linking to the GitHub branch. Re-activate anytime with make snapshot-activate.
The site is deployed to Cloudflare Pages via GitHub Actions. Pushes to master trigger the deploy workflow (.github/workflows/deploy.yml), which:
- Generates docs from the bactopia source repo
- Builds the Docusaurus site
- Fetches active version snapshots from their orphan branches
- Deploys the assembled output to Cloudflare Pages