Static Site Generator

How-to: How to host my static website for free?

How to host my static website for free?

There are many tools to publish your site for free:

And certainly still others.

In any case, you just have to share the content of the web/prod folder. Here is the way to host your website on Github Pages.


Step 1

Order a domain name from your preferred registrar.

Step 2

Configure StaPy with the full host as the base URL for the prod environment:

+--- layout
   +--- common.json
  "url.local": "http://localhost:1985/",
  "": ""

Step 3

We need to tell GitHub Pages our domain name. That can be done by creating a CNAME file containing the domain.

+--- assets
   +--- CNAME

The CNAME file in the assets directory will be copied to the website root.

Step 4

Start the StaPy server and crawl all the pages:

python tools/

Step 5

Create a new public repository named where username is your username on GitHub.

Step 6

Commit and push all the static files on the Github repository.

cd web/prod
git init
git add -A
git commit -m "first commit"
git branch -M main
git remote add origin{username}/{repository}.git
git push -u origin main

Step 7

On your Github repository, go to Settings > Pages. Enable Pages for the root directory on the main branch.

Add your custom domain ( and enforce HTTPS.

Step 8

From the registrar, edit the DNS zone and add a CNAME record for the www subdomain:


How to add a new block?
How to add a new blog post?
How to display a list of links?
How to use dynamic data?
How to use Stapy on Windows?
How to host my static website for free?