Static site generator inspired by jekyll but much improved
Features:
- jinja templating language
- written in python: easy to install modify and extend
- built in redirects, sitemap and html checking.
- support for resusable templates, allow reference to
templates
dir. or list of dirs, thereby allowing just a single file to be overruled. - auto-reload with dev. server
- dynamic static file names to work well with CDNs
- support for markdown and/or restructured text
- sass compiling
- partial rebuilds for performance
- auto deploy and check commands with
scp
,git
and maybe more providers, includingbuild.txt
generation - multi-frontmatter, eg. support for more than one content section to pages
- support variables inside pages
- allow for easy extension
- allow generation of nginx redirect
.conf
pages config.local.yml
support so you can run things differently locally- link conversion and default template link mkdocs
- bower or grablib support
Context of a page:
. (page data in root of context): variables from frontmatter, name, path
site: full site object, including list of pages, tree of pages, pages with tags
data: data from data directory.
---
layout: foo
---
this is content
becomes:
{"content": "this is content"}
{% extends 'foo.jinja (or html)' %}
{% block content %}
this is content
{% endblock %}
---
layout: foo
whatever: 4
---
{% block foo %}
this is content
{% endbock %}
{% block bar %}
this is content
{% endbock %}
becomes:
{"whatever": 4}
{% extends 'foo.jinja' %}
{% block foo %}
this is content
{% endbock %}
{% block bar %}
this is content
{% endbock %}
---
layout: foo
---
this is content
{% block bar %}
this is content 1
{% endbock %}
becomes:
{"content": "this is content 1"}
{% extends 'foo.jinja' %}
{% block content %}
this is content 1
{% endbock %}
{% block bar %}
this is content
{% endbock %}
---
layout: foo
multi: list
---
this is content 1
---
---
this is content 2
becomes:
{"content": ["this is content 1", "this is content 2"]}
{% extends 'foo.jinja' %}
---
layout: foo
multi: dict
key: first_element
---
this is content 1
---
key: foobar
something_else: 4
---
this is content 2
becomes:
{"content": {"first_element": "this is content 1", "foobar": "this is content 2"}}
{% extends 'foo.jinja' %}
---
layout: foo
multi: dict
---
this is content 1
---
foobar
---
this is content 2
becomes:
{"content": {"primary_content": "this is content 1", "foobar": "this is content 2"}}
{% extends 'foo.jinja' %}
{% block content %}
this is content 1
{% endblock
from jackal import extensions
from jinja2 import contextfunction,
@extensions.modify_page('foobar.html', '/path/to/bar.md')
def modify_pages(template, context):
context['whatever'] = 'changed'
return template, context
@extensions.modify_context
def modify_entire_context(context):
context['change'] = 1
return context
@contextfunction
def whatever(context, file_name):
return 'context to render'