inseven / incontext-python

Extensible static site generator
https://incontext.app
MIT License
4 stars 1 forks source link

InContext (Python)

Extensible static site generator

This Python version of InContext has now been replaced with a newer Swift implementation and is no longer being maintained.

Background

Most existing static site generators do a great job with text content, but treat media as an afterthought. InContext handles Markdown just as well as generators like Jekyll, and adds native support for photos and video. Adding support for additional media types is simply a matter of adding a new handler.

Installation

  1. Install Docker
  2. Clone the repository:
    git clone git@github.com:inseven/incontext.git
  3. Add InContext to your path:
    export PATH=$PATH:/path/to/incontext

Getting Started

incontext new my-new-site
cd my-new-site
incontext build

Front Matter

InContext has a few special Front Matter properties.

Include

By convention, collection templates are expected to use the include property to determine which document categories are included.

For example,

include:
  - posts
  - photos

Exclude

By convention, collection templates are expected to use the exclude property to determine which document categories should be excluded.

For example,

exclude:
  - drafts
  - screenshots

Sort

Collection templates make use of the sort property to determine the date-based sort order of content.

For example,

sort: ascending

or,

sort: descending

Templates

InContext uses Jinja2 for templating with some additional custom filters. Check out the Jinja2 Template Designer Documentation for basic usage.

History

InContext is named after a Perl static site generator I wrote in 2005 (and failed to publish). Back then, every piece of software I wrote was named with the 'In' prefix in keeping with my in7.co.uk domain name (e.g., InJapan, InModem). Hopefully this is more widely useful than my first attempt.

InSeven Limited is still the name of my company.