Skip to main content

Static site generator

Project description

Bass

Bass is a static website generator (Bass=Build A Static Site), written in Python 3. It turns a collection of content pages, assets (PNG, CSS, JS etc.) and templates into a static website, i.e. a website consisting only of directories, HTML pages and the same assets. Bass is distributed under the MIT license (see the LICENSE file for more details).

The idea behind a static site generator is that you don't need a content-management system on the server to generate pages dynamically: you generate the content, upload it to the server, and repeat this process when something has changed. That way, there is no need to install complex software on the server, with the associated maintenance effort (software upgrade, backup) and security issues.

The design of Bass borrows ideas from Wok and other static site generators (see overview). Before I created Bass, I used Wok for about a year, created two websites with it, and also looked at alternatives. During that year I noticed several drawbacks, which led to the development of Bass.

The most important feature of Bass is that it gives the user complete freedom in organizing the input directory, considers this organization as meaningful, and therefore preserves it in the site tree. With organization of the input directory I mean: (1) the structure of the tree of files and sub-directories in the input directory, and (2) the names of files and sub-directories. This concept was borrowed from Wintersmith. Other static site generators are designed primarily for blog sites, and use an input directory with a fixed structure, or completely ignore the structure of the input directory, creating the structure of the site tree from metadata (Wok for example).

Other features that were added: extension through generic event mechanism (inspired by Pelican and Wok); use of template engines other than Jinja; ignoring specified files in the content directory (e.g. Emacs backup files); flexible pagination.

Documentation

Documentation is in the doc directory. An example site is in the test directory.

Installation

The recommended way to install Bass is from the Python Package Index with this command: sudo pip install bass.

Dependencies

All dependencies are available through pip. Although optional, you should at least install one of the following three tools:

  • Markdown (Markdown2 is an alternative)
  • Docutils
  • Textile

If you install with pip, Markdown2 will be installed automatically.

Required

  • pyyaml
  • Chameleon

Optional

  • Markdown or Markdown2, for rendering Markdown documents.
  • Docutils, for rendering ReStructuredText documents.
  • Textile, for rendering Textile documents.
  • WebOb, for a more advanced web server.
  • Waitress, for a faster web server.

Usage

To use Bass, go to the project directory (the directory where the input files and generated site will be located), and run the command bass -c or bass --create. This will create a basic directory structure and corresponding configuration file. You can change the names of the directories, provided you apply the changes in the configuration file as well.

Put your content in the input directory (default: input). Build the site with bass -b or bass --build. If you want to see debugging information, use bass -b -d or bass --build --debug.

If you add the option -s or --serve, Bass will generate the site as usual, and then start a simple web server on port 8080. This web server is intended solely for local testing of the site during the development phase.

If the Python package WebOb is available, a slightly more advanced server (WSGI) is made available. This server checks for changes in the input and layout directories (see the manual) whenever a page is requested. If it detects a change in either of these directories, the site is regenerated before the page is returned. If the Python package Waitress is also installed, this WSGI-based server is replaced with a faster one.

About

Bass is written by Nico Poppelier and licensed under the MIT license.

The name is just another acronym. Several other site generators (e.g. Wok, Wintersmith, Jekyll, Pelican, StrangeCase) inspired this project.

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

bass-1.4.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

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

bass-1.4.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file bass-1.4.0.tar.gz.

File metadata

  • Download URL: bass-1.4.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bass-1.4.0.tar.gz
Algorithm Hash digest
SHA256 aee3c014c26246e72789a0c8d442b88ccae359312039cc09f4618833aabbf760
MD5 af483e62ede1bed7fa84911482e75659
BLAKE2b-256 121993a241944fa3faa24c7a819c6706a76dd7ac26c0e55f19933ce7fee67c83

See more details on using hashes here.

File details

Details for the file bass-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: bass-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bass-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e33649ca17da43c1328239cd5f395581bcad1921e9f7dcd5e05f14f4f0470dea
MD5 8b41de3380defda503a36eb887f00e54
BLAKE2b-256 ecf2eb765c7f170edf03d54cb344b312f3ff076d867b29dc643828ef4084c506

See more details on using hashes here.

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