Skip to content

Latest commit

 

History

History
53 lines (31 loc) · 1.98 KB

README.md

File metadata and controls

53 lines (31 loc) · 1.98 KB

static_page_generator

This is a static page generator.

An example of a website generated by it can be found at jduarte.eu.

I initially only wanted to create a simple website. Most of the tools I work with are overkill for a static website and I didn't feel like hand writing and copying HTML code a bunch of times.

I could technically learn how to use one of the many available static website generating tools, but I felt like the concept itself seemed simple enough that I might as well do it myself.

So here it is. By this point, I can't even remember exactly what I wanted to create a website for, but whatever it might be, this tool aims to help me do that.

[UPDATE AUGUST 2022]

By this point, this is less of a generic static page generator and more of static picture gallery website generator. It is what it is.

Functionality

The generator currently has two generating behaviours: text pages and image galleries.

Text pages are HTML pages converted from Markdown documents. These should be stored inside the data/pages directory. See the about.md document for an example.

Photo galleries are generated from photos containing keyword data. Each keyword will generate a section containing the pictures with that keyword. All photos will be displayed in the index. Your photos should be stored inside the data/images directory.

Running the docker container then sets up an nginx server with the pages you've just generated.

You can copy the folders in example_content into the data directory to generate an example page.

Development

If you want to try running this, I recommend setting up a virtual environment. For example:

$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Then, in order to generate the website structure, run:

$ python src/main.py

You can then run the container with:

$ docker-compose up --build

Et voilà!

You should be able to access your new empire website at localhost:80.