Skip to content
/ ggpy Public

The Good Generator for static websites and blogs

License

Notifications You must be signed in to change notification settings

ooz/ggpy

Repository files navigation

Good Generator.py

CircleCI GNU AGPLv3 Badge MIT License Badge Changelog


Yet another static site generator. Written in Python. Why?

It powers its website, which is its README.md rendered via CircleCI. An infinite incepted loop! It also powers my website and blog.

Features

  • Static site generator supporting Markdown with various extensions and Markdown meta header format
  • Renders all *.md to *.html files in the passed directories and recursively in their sub-directories
  • Files named README.md are converted to index.html. Thus, it is fully compatible with GitHub Pages
  • It may render a time-stamped index of all generated HTML files, suitable for blogs. Documents may also be inlined into the index, suitable for micro-blogs
  • Built-in responsive style with light mode and dark mode
  • Open Graph and schema.org support
  • Generates sitemap.xml with lastmod timestamps taken from git history
  • Generates rss.xml RSS feed
  • Requires python3, pip, and optionally git (for more accurate, CI-friendly timestamps) and make if you want to use the provided Makefile. Thus, it runs in Termux on Android
  • The provided CircleCI configuration may serve as a blueprint to let CircleCI build your page on every commit

Usage

  • Copy gg.py, ggconfig.py, Pipfile and Makefile to the root of your website/blog
  • Adjust ggconfig.py to your preferences. Since it is an imported Python file, you can use it for preprocessing hooks, too!
  • Place markdown files everywhere
  • Install dependencies
make install_pipenv
make init
  • Generate your site
make
  • To update your gg.py "installation", run (your configuration will not be touched)
make update
  • See all make targets with short documentation
make help

Tests

  • Install dependencies (if you have not yet)
make install_pipenv
make init
  • Run tests with coverage
make test

License

This software is dual-licensed under GNU AGPLv3 or MIT License, see LICENSE.txt file for details.