Δ All posts
Django Meta tag management
20 July 2010
Synopsis: I wanted an easy way to manage my website's meta-data so I made a lightweight admin app for the job.
Ugh
Templates proved to be a really ugly place for it because of the way inheritance works. I'd have to create a bunch of blocks and do overrides, etc. Plus, if I didn't specify some data in a sub-page, it would just use the top-level information. This was causing me big problems in google, which was just seeing duplicate page information, which led it to ignore all my meta-data. Ugh.
Research
I checked out a few other projects but I didn't like any of them.
-
http://code.google.com/p/django-metatags/ - Perfectly lightweight but strange the way it modifies your templates. Locks you in. Also didn't collect all the data I wanted (keywords, title, and description)
-
http://github.com/nateanderson/django-metatags - obtrusive. hard to implement.
-
http://code.google.com/p/django-seo-tools/ Lots of neat features but ultimately a code-megasaur, bogged down by its sheer size. Not to mention a dependancy nightmare (I stopped at its demanding I have django-south installed)
Redo
After a few drafts I came up with something I like a lot http://github.com/subsume/django-metatags.
Essentially you get an admin interface for your metadata. You specify a path or a url name (haven't seen this before!) and then fill in some fields (keyword, description, title). What's neatest, is that these fields are rendered in the context of the page in question. Yes, it does seem a bit kludgy to have template code in the admin interface, but they're rather small snippets and its nice being able to quickly edit the metadata in situations where you want to lean on a particular keyword for a little while.
