Commit 8eb7e26f by Andreas

<code> => <pre><code>

parent 53d48f21
......@@ -22,12 +22,12 @@ bump_filename was broken because a lot of caches does not properly cache files w
E.g.:
<pre>
<code>
<pre><code>
'screen': {
'source_filenames': ('css/screen/style.css', 'css/screen/paginator.css', 'css/screen/agenda.css', 'css/screen/weather.css', 'css/screen/gallery.css', ),
'output_filename': 'c/screen.r?.css',
},
</code>
</code></pre>
</pre>
* COMPRESS_VERSION requires COMPRESS_AUTO to be enabled. COMPRESS_AUTO is enabled by default, but if you explicitly set it to `False` an ImproperlyConfiguredError exception will be thrown.
......
......@@ -8,7 +8,7 @@ h3. Specifying files
You specify groups of files to be compressed in your settings. The basic syntax for specifying CSS/JavaScript groups files is:
<code>
<pre><code>
COMPRESS_CSS = {
'group_one': {
'source_filenames': ('css/style.css', 'css/foo.css', 'css/bar.css'),
......@@ -28,7 +28,7 @@ COMPRESS_JS = {
'output_filename': 'js/all_compressed.js',
}
}
</code>
</code></pre>
h4. Group options
......@@ -45,7 +45,7 @@ h3. Other settings
* </tt>COMPRESS_VERSION</tt>: regulates whether or not to add a "version number" to the outputted files filename with for use with “far future Expires”. For more information, see [FarFutureExpires]. When you specify </tt>COMPRESS_VERSION</tt> you will also need to add a placeholder (which by default is '?') for the version number in the </tt>output_filename</tt> setting. Files with new filenames will be generated if needed, and old outdated files will be removed at the same time. All files with a matching name e.g. </tt>output_filename</tt> where ? can be replaced by digits will be removed. If you for some reason have files named in the same way, you should consider moving them or putting the compressed files in their own directory.
</tt>COMPRESS_VERSION</tt> Example:
<code>
<pre><code>
COMPRESS = True
COMPRESS_VERSION = True
COMPRESS_CSS = {
......@@ -54,7 +54,7 @@ COMPRESS_CSS = {
'output_filename': 'c/screen.r?.css',
},
}
</code>
</code></pre>
This will output a file like <tt>/media/c/screen.r1213947531.css</tt>, which will be re-generated and updated when you change your source files.
......
......@@ -28,19 +28,19 @@ See documentation for more information:
* [http://httpd.apache.org/docs/2.2/mod/mod_expires.html mod_expires in Apache documentation]
h4. Example
<code>
<pre><code>
<Directory /your/media/root/css>
ExpiresActive on
ExpiresDefault "access plus 10 years"
</Directory>
</code>
</code></pre>
Apache also allows the specify files by their mime-type:
<code>
<pre><code>
ExpiresActive On
ExpiresByType text/css "access plus 10 years"
ExpiresByType application/x-javascript "access plus 10 years"
</code>
</code></pre>
h4. lighttpd
......@@ -51,7 +51,7 @@ h4. Example
Set far future headers on all files under /media/css/ and /media/js/.
<code>
<pre><code>
$HTTP["url"] =~ "^/media/css/" {
expire.url = ( "" => "access 10 years" )
}
......@@ -59,7 +59,7 @@ $HTTP["url"] =~ "^/media/css/" {
$HTTP["url"] =~ "^/media/js/" {
expire.url = ( "" => "access 10 years" )
}
</code>
</code></pre>
h4. nginx
......@@ -69,7 +69,7 @@ nginx's <tt>ngx_http_headers_module</tt> provides the <tt>expires</tt> option, w
h4. Example
This will set expiration to the maximum expiration:
<code>
<pre><code>
location /media/js {
expires max;
}
......@@ -77,4 +77,4 @@ location /media/js {
location /media/css {
expires max;
}
</code>
\ No newline at end of file
</code></pre>
\ No newline at end of file
......@@ -11,9 +11,9 @@ h3. Management command
You can update and force updates of the compressed file(s) with the management command “synccompress”. This makes it possible to keep the files updated manually.
The command is
<code>
<pre><code>
./manage.py synccompress
</code>
</code></pre>
(assuming you are in you project-folder that contains <tt>manage.py</tt>). To force all files to be re-generated, use the argument <tt>--force</tt> (e.g. <tt>./manage.py synccompress --force</tt>)
......@@ -29,12 +29,12 @@ h4. Example
If you have specified the CSS-groups “my_screen_css” and “my_print_css” and a JavaScript-group with the name “my_scripts”, you would use the following code to output them all:
<code>
<pre><code>
{% load compressed %}
{% compressed_css 'my_screen_css' %}
{% compressed_css 'my_print_css' %}
{% compressed_js 'my_scripts' %}
</code>
</code></pre>
h3. Far future Expires
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment