dreikanter / public-static

Programmer's approach to web content management
https://github.com/dreikanter/public-static
BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

Process page contents with Jinja #62

Closed dreikanter closed 11 years ago

dreikanter commented 11 years ago

Transform this

title: Some page
template: page

Page content.

into this

{% extends "page.html" %}
{% block content %}
Page content.
{% endblock %}

and use env().from_string() to get the template (already populated with page content).

This change will enable Jinja2 syntax inside page content, which allows to use it to insert images this way:

{{ img(451) }}

On template extension: http://jinja.pocoo.org/docs/templates/#template-inheritance