simple static page generator written in python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jan Wolff c44a40b379 fix active page link being broken, when the page is a markdown page 1 year ago
LICENSE.md removed unfinished blog code - fix readme - started versioning using semver 1 year ago
README.md removed unfinished blog code - fix readme - started versioning using semver 1 year ago
install.sh Added shebang (default python2.7 path for ubuntu) and install script 2 years ago
mkpage.bat Nice .bat file for windows and cleanup 2 years ago
mkpage.py fix active page link being broken, when the page is a markdown page 1 year ago

README.md

MkPage

MkPage can glue together several sub-pages into a template and generate a consistent navigation.

Anything more and this project would reinvent the wheel, because Jekyll and/or Hugo already exist.

Usage

To use MkPage you’ll need to setup a directory in a certain way. It needs to contain:

  • a pages.json file, which contains information about all pages you want to include
  • a template.html file, which is your basic layout, where all other content will be copied into
  • a “pages” subdirectory, which contains all your different pages
  • (optional) an “assets” subdirectory, which contains all auxilary files you want to use (stylesheets, images, etc.)
  • a “generated” subdirectory, in which your page will be generated

pages.json

This file contains all pages you want to include. It has the following format:

{
    "title": "Site",
    "subtitle": "My cool site",
    "author": "Me",
    "template": "template.html",
    "pages": [
        {
            "title": "home",
            "file": "index.html"
        },
        {
            "title": "the invisible man",
            "file": "invisble.html",
            "hidden": true
        }
    ]
}

The hidden attribute can optionally be set. It allows you to generate pages, but not include them in your navigation.

template.html

This file should just be a regular html file, complete with <html> tags and a doctype. Place “$MENU$” in your template, where you want your navigation to be (it is a <ul> filled with links). The page’s title will be placed at “$TITLE$” and the page’s actual content will be placed at “$PAGE$”.

pages

A page file must only contain tags, that would make sense in it’s position in the template. So no <html>, <body> or anything.