Tiny lightweight static site generator written in Python that uses markdown and liquid to generate a website.
The way it works is simple by design. The litestatic script checks for a site directory, which is your website's source directory. A template site_template is provided as a submodule, which can be copied and modified for your site. The (site_directory)/templates directory contains liquid templates for generating the html skeleton of your website. Markdown is used for the webpage contents. The index.md is the markdown file that generates the front page of the website.
You can put markdown files in the site directory and have them generated as (site_directory)/(page name). You can also put html in the markdown files and it will render in the body.To customize the html outside the body use templates. For javascript you can source your scripts either in the markdown files or html template. You can also have blog-style posts by putting markdown files in the site/(posts_directory)/ directory. posts_directory is by default posts.
The name for the posts needs to be formatted as: (posts_directory)/YYYY-MM-DD-title.md.
The posts need to have a metadata header:
title: Post Title
date: YYYY-MM-DD HH:mm
Posts will be indexed in /posts which you can link in index.md or anywhere else.
The (site_directory)/files/ directory is for any miscellaneous files that get copied to the output directory out/.
The generated website is outputted to the output directory ready to be deployed to a web server or wherever.
You can configure many things, such as blog post generation, the name of the index page, rss feed generation, and the posts directory.
To configure these things, copy the config_template.yaml to your site directory.
If you change the posts_directory you must also rename it in your site directory, since that is the directory it will look for at generation time. This will change the url where your posts are, for example if you want it to be /blog such as example.com/blog change the posts_directory to blog.
You can generate an RSS feed (posts_directory)/rss.xml by setting rss_feed_generation in the config.yaml to True. You need to set a site_url, language, and feed_description. If you do not set an index_page_title it uses the site_url as the RSS feed title.
If you want to install litestatic from the pip repositories, run:
$ pip3 install litestatic
If youw want to install litestatic from this repo, follow these instructions:
First you need to install the requirements:
$ pip3 install -r requirements.txt
Next, install litestatic using pip:
$ python3 -m pip install .
Provide your own site directory or use the template and modify it to your needs:
$ git submodule update --init
$ cp site-template (site_location)
Next, edit the site how you see fit.
Finally, to generate a website run:
$ litestatic (site_directory) (output_directory)
To view your website locally, run a web server:
$ python3 -m http.server -d (output_directory)
Here are some screenshots of the example site to demonstrate what litestatic can do.



