Skip to main content

A custom Python static site generator for polished documentation websites.

Project description

Staticnest

staticnest is a custom Python static site generator built for documentation sites with a polished docs-first visual style: strong typography, left navigation, right table of contents, responsive docs shell, and client-side search.

Features

  • Pure Python generator with no runtime framework dependency
  • TOML-based site configuration
  • YAML navigation file for explicit sidebar order and sections
  • Front matter for page metadata, summaries, template choice, draft state, and nav ordering
  • Markdown support for headings, paragraphs, lists, blockquotes, fenced code blocks, and links
  • Heading-based table of contents
  • Responsive theme with mobile navigation and in-page search
  • Local dev server with rebuild-on-change and live reload
  • CLI preview and publish commands
  • One built-in nest theme
  • User template and asset overrides from theme/

Repository layout

This repository now contains two separate things:

Project layout

.
└── src/staticnest/

Example site layout:

examples/docs-site/
├── content/
├── navigation.yml
└── site.toml

Run locally

Create a new docs project:

python3 build.py init my-docs

That scaffolds:

  • site.toml
  • navigation.yml
  • content/

Then build it:

python3 build.py build --config my-docs/site.toml

Or preview it locally:

python3 build.py preview --config my-docs/site.toml --host 127.0.0.1 --port 8000

You can also initialize the current directory with:

python3 build.py init

For the bundled example site in this repository:

python3 build.py build --config examples/docs-site/site.toml

For local development:

python3 build.py preview --config examples/docs-site/site.toml --host 127.0.0.1 --port 8000

To publish the final output:

python3 build.py publish --config examples/docs-site/site.toml

To deploy to GitHub Pages:

python3 build.py gh-deploy --config examples/docs-site/site.toml

If you prefer the console script after installation:

pip install -e .
staticnest build --config examples/docs-site/site.toml

The example site's generated output is written to examples/docs-site/dist.

Author content

Create .md files inside content/. The first # Heading becomes the page title unless front matter overrides it.

Navigation

Sidebar navigation comes from navigation.yml, not from the file tree.

- title: Overview
  page: index.md
- title: Guides
  items:
    - page: docs/getting-started.md
    - page: docs/configuration.md

Each navigation item can use:

  • title
  • page
  • url
  • items
  • order

You can also configure the top header navigation in the same file:

- navigation-bar:
    github:
      title: GitHub
      link: https://github.com/your-org/your-repo
      logo: https://github.githubassets.com/favicons/favicon.svg
    resources:
      title: Resources
      items:
        - name: Release notes
          link: https://example.com/releases
        - name: Roadmap
          link: https://example.com/roadmap
- issues:
    title: Issues
    link: https://github.com/your-org/your-repo/issues

The built-in theme treats navigation-bar.github as a dedicated top-right logo link, not a center navigation item. Other navigation-bar entries render just to the left of search. Add:

  • title for the accessible label and text fallback
  • link for the GitHub destination
  • logo for the image shown in the header
  • alt for custom image alt text if needed

If you add a top-level issues.link, the built-in theme uses it for the Question? Give us feedback link in the right-side table of contents.

Front matter

Use either YAML-style --- blocks or TOML-style +++ blocks at the top of a page.

---
title: Architecture
nav_title: System Design
order: 4
summary: Explain the pipeline and page rendering model.
template: page.html
draft: false
---

Supported fields:

  • title
  • nav_title
  • order
  • summary
  • template
  • draft

Theme overrides

The soft launch ships with one built-in theme:

[theme]
name = "nest"

Optional advanced overrides can still be added with [theme].dir:

[theme]
name = "nest"
dir = "theme"

If [theme].dir is set, the generator will:

  • copy theme/assets/* into dist/assets/
  • auto-load theme/assets/custom.css
  • auto-load theme/assets/custom.js
  • use theme/templates/page.html as the outer shell override
  • use template: <name>.html in front matter to select other templates

The CLI does not scaffold theme/ by default because the built-in nest theme is bundled with the package. A local theme/ directory is only needed for advanced overrides.

Publish workflow

publish uses the configured output_dir by default. If you want a different destination for a specific run, pass --destination.

gh-deploy builds the site, ensures GitHub Pages artifacts like .nojekyll and 404.html exist, and force-pushes the output to a gh-pages branch. It expects to run inside a Git repository with a configured remote.

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

staticnest_cli-0.1.5.tar.gz (46.0 kB view details)

Uploaded Source

Built Distribution

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

staticnest_cli-0.1.5-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file staticnest_cli-0.1.5.tar.gz.

File metadata

  • Download URL: staticnest_cli-0.1.5.tar.gz
  • Upload date:
  • Size: 46.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for staticnest_cli-0.1.5.tar.gz
Algorithm Hash digest
SHA256 4ce2aae583ee05bce8fa74834f6bd8bd37947ce6310f679cad4e311895bee7d7
MD5 e344642c0c8ce36657e999a85d11ec3d
BLAKE2b-256 b4137a4cf1fe1787b9a70c474b9c44985580b7f25108c5719104023910792ea0

See more details on using hashes here.

Provenance

The following attestation bundles were made for staticnest_cli-0.1.5.tar.gz:

Publisher: publish.yml on Dev-kitx/staticnest-cli

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

File details

Details for the file staticnest_cli-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: staticnest_cli-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for staticnest_cli-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 214e321dfd92439c4daabc99cf8869b593a82f23c2bad4697ddff9d1daaba261
MD5 fd9239564cb9e2f05483ed246c72ec9e
BLAKE2b-256 fa8a1afe26a51e6b3d5c10f4818859ea995a17657ba695c31045898368db62b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for staticnest_cli-0.1.5-py3-none-any.whl:

Publisher: publish.yml on Dev-kitx/staticnest-cli

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