logo

Δ 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.

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.

Essays

View all