Skip to main content

Flat file blog tool bult on Jinja2 templates

Project description

Installation

To get the latest released version:

pip install stanley

Initialising a new project

To initialize a skeleton file structure use

python /my/site-packages/stanley/bin/project project_dir

This will create a directory structure inside the directory specified contains config.yml and a satanly utils file - like this

/content
/site
/static
/templates
config.yml
config.dev.yml
stanley

This will NOT overwrite existing files, just create those that are missing.

Build .html Site

To build .html files from your content use

python stanley build --config=config.yml

This will take all of the files in content, parse them as markdown, convert the YAML front matter and render it into its specified template and save it in the site directory. The static folder is then copied across as-is.

Templates

Templates are Jinja2 http://jinja.pocoo.org/ there is no functionality added or removed.

Looping over content/posts/entries

Looping over entries uses existing Jinja2 functionality with the stanley.Posts object, you use it like this:

{% for post in posts.category('/blog').limit(5).result %}
    // do whatever
{% endfor %}

For all of the posts just use

{% for post in posts.result %}
    // do whatever
{% endfor %}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stanley-1.4.5.tar.gz (6.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page