Home

Awesome

Dewar

Dewar is a static site generator inspired by flask.

About

Why the name "dewar"?

Dewar (pronounced d-you-ah) is another name for a vacuum flask, or a thermos. Basically, it's a flask that keeps things frozen (or hot).

Why would I use this?

To the moment, there have been a few ways of making a static site:

This might work for a small site, or for a repetitive report; but maintainability is lost, and a lot of custom configuration has to be done.

These are great for making blogs, but are opinionated about what content they should host. They don't allow for computation inline, and they are their own ecosystem to learn.

Just use flask!

There are two major limitations to flask that this project solves:

  1. Flask only serves one page at a time.
  2. Flask requires a server to be running.

These limitaions are obvious, but they prevent a few use cases:

Setup

Installing Dewar is as simple as:

pip install dewar

And writing a program like

# named 'site.py'
import dewar

site = dewar.Site()

@site.register('index.html')
def index():
    return "<h1>Hello, World</h1>"

if __name__ == "__main__":
    site.render()

Then,

$ python3 site.py

That's it! Your static site is now in dist/.