Login

Tag "html5"

Snippet List

Make HTML5 appcache manifest slice work with django-compress compressed files

I needed to make appcache for my application which used django-compress for JS and CSS compression. This is, how I solved the problem with putting compressed files into the manifest. I went for offline compression (with `COMPRESS_OFFLINE=True`). This snippet shows code of command file (put it in `apps/cyklomapa/management/commands/compress_create_manifest.py`), which creates `compress_cache_manifest.txt` file in my templates. Then I just use `{% include "compress_cache_manifest.txt" %}` in my appcache template.

  • html5
  • django-compress
  • appcache
Read More

Prettify HTML5 middleware

Slightly updated version of http://djangosnippets.org/snippets/172/ . Supports new HTML5 tags (even though tidy doesn't).

  • middleware
  • tidy
  • standard
  • html5
Read More

Share button

This template can be included by other template passing the vars page_url and title: {% with content.get_url as page_url %} {% with content.title as title %} {% include 'share.html' %} {% endwith %} {% endwith %}

  • google
  • facebook
  • twitter
  • html5
  • linkedin
  • reader
  • share
Read More

HTML 5 Firefox 2 Hack

This is a hack to get HTML 5 to work for Firefox 2. It Sends the xhtml content-type to all Gecko based browsers where version is less than 1.9, or "rv:1.9pre" or "rv:1.9a" or "rv:1.9bx" where x is less than 5. I created this hack based on the information I found on this site, http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/. Just put this code in one of your middleware files (i.e. mysite/middleware.py) and then add it in your MIDDLEWARE_CLASSES in your settings.py. Example: MIDDLEWARE_CLASSES = ( ... 'mysite.middleware.HTML5Firefox2Hack', ... )

  • middleware
  • html5
Read More

6 snippets posted so far.