Skip to main content

Chameleon support for templating in Lektor.

Project description

PyPI version. Project license.

lektor-chameleon is a plugin for the Lektor static site generator that makes is possible to write the templates using the Chameleon template engine.

To use the plugin, add it to your project:

lektor plugin add lektor-chameleon

Since the plugin modifies the default environment, it requires that it will be explicitly enabled. To enable the plugin, create the file configs/chameleon.ini and put the following lines into it:

enabled = yes

Usage examples:

<html lang="${this.alt}">

<h1 tal:content="this.title">Page title</h1>

<span tal:replace="bag('translate', this.alt, 'message')">message</span>

Many Lektor and Jinja filters are available using the >> operator:

<a href="${'/' >> url}">Home page</a>

<link rel="stylesheet" href="${'/static/custom.css' >> asseturl}"/>

Filters also accept parameters:

<a href="${'.' >> url(alt=this.alt)}">link text</a>

But filter parameters must be given as keyword parameters:

<!-- incorrect -->
<div tal:replace="this.body >> indent(4)">Page body</div>

<!-- correct -->
<div tal:replace="this.body >> indent(width=4)">Page body</div>

0.5.1 (2019-08-11)

  • Fix preliminary support for flowblock templates.

0.5 (2019-08-04)

  • Require explicit enabling of plugin.

0.4 (2019-08-02)

  • Correctly track template dependencies during builds.
  • Switch to BSD license.

0.1 (2018-10-28)

  • Initial release.

Project details

Download files

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

Files for lektor-chameleon, version 0.5.1
Filename, size File type Python version Upload date Hashes
Filename, size lektor-chameleon-0.5.1.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page