StaticSite Github 1bcd93e969bf38a354cc3b3c7efab024


An stupidly simple static site builder using Jinja2. This current documentation is built using staticsite itself.

Refer to the code or open an issue if something is unclear.

  1. Create a src directory.
  2. Create your source files in that directory.
  3. Run python -m staticsite build to build your site into the docs directory.
  4. Serve your site with cd docs && python -m http.server at http://localhost:8000

Folder structures

Note:Files with a leading . are not rendered into the final site.

Note:A .sitehash.txt file is added to the final results denoting a hash for the build.

├── src
│   ├── .autoreload.html
│   ├── .base.html
│   ├── css
│   │   └── .base.css
│   ├── .examples.html
│   └── index.html
└── docs
    ├── index.html
    └── .sitehash.txt

Developing the site

python -m staticsite watch keeps re-rendering your site as soon as it detects changes.

You can then use {% include '.autoreload.html' %} in your site's base tempate, which will reload your site in the browser when the source files change.

If you build your site using pyton -m staticsite build then the auto reload part is not included, leaving you with a static site.