djangosnippets.org: Latest snippets tagged with 'slimmer'https://djangosnippets.org/tags/slimmer/2008-09-14T05:27:21.115324-05:00whitespaceoptimize block tag
2008-09-14T05:27:21.115324-05:00peterbehttps://djangosnippets.org/snippets/1055/<p>This is a custom block tag and is used like this:</p>
<pre><code>{% load whitespaceoptimize %}
{% whitespaceoptimize "css" %}
/* CSS comment */
body {
color: #CCCCCC;
}
{% endwhitespaceoptimize %}
</code></pre>
<p>And when rendered you get this output:</p>
<pre><code>body{color:#CCC}
</code></pre>
<p>To install it, download the snippet and call it <code>myapp/templatetags/whitespaceoptimize.py</code>. …</p>
Freely redistributable