Mako template support for django_compressor
Project description
This module provide mako template support for Django Compressor.
Usage
All you need to do is to import extension namespace and using it with mako syntax:
<%namespace name="compress" module="django_compressor_mako"/>
<%compress:compress kind="css">
<link rel="stylesheet" href="/static/css/style.css" type="text/css" />
</%compress:compress>
All django-compressor arguments are supported but must be explicitly named:
kind: mandatory, “css” or “js”.
mode: optional, compressor mode, “file” or “inline”.
name: is not supported and will raise a NotImplementedError
Outputs cannot be named and are just named using hash plus extension.
Also note that mako template doesn’t allow blocks inside of <%call>, that means you cannot use the following syntax:
<%namespace name="compress" module="django_compressor_mako"/>
<%compress:compress kind="css">
<%block name="more_css"/>
</%compress:compress>
Shorter functions
Additionally two shorter functions are provided, css and js, same arguments can be passed except kind which is set by default depending on which one is used, eg.:
<%namespace name="compress" module="django_compressor_mako"/>
<%compress:css>
<link rel="stylesheet" href="/static/css/style.css" type="text/css" />
</%compress:css>
<%compress:js>
<script type="text/javascript" src="/static/js/script.js">
</%compress:js>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for django_compressor_mako-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23d92e8bc4230da628fb024e80f864f8c48b1354195898c068efa5616e0b211b |
|
MD5 | 731453a964cf89465dca7fd6a8a5ebe3 |
|
BLAKE2b-256 | 659fe2c6f2eef9626b88027b846bf020ca46d09ddaa4022acf93348e12c3986b |