lektor-chameleon is a plugin for the Lektor static site generator that makes is possible to write the templates using Chameleon.
To use the plugin, add it to your project:
lektor plugin add lektor-chameleon
Templates must have the .pt
file extension.
Usage examples:
<html lang="${this.alt}">
<h1 tal:content="this.title">Page title</h1>
<span tal:replace="bag('translate', this.alt, 'message')">message</span>
All custom Lektor filters are available as functions:
For convenience, the following Jinja filters have also been made available as functions:
Usage examples:
<a href="${url('/')}">Home page</a>
<a href="${url('/', alt=this.alt)">link text</a>
<link rel="stylesheet" href="${asseturl('/static/custom.css')}"/>
<div tal:content="striptags(this.body)">Shortened body text</div>
<div tal:replace="indent(this.body.html, 2)">Page body</div>
<body>
${ structure:wordwrap(this.body.html, width=72) }
</body>