getpelican/pelican — pull request #1199 by kalefranz (2013-12-26 04:59:11+00:00)
Title: Add url and save_as to jinja2 context for all relevant generators

The `url` for the file being written is incredibly useful (and actually necessary!) within the Jinja2 context when templating. However, the url is always attached to a `Content` or `URLWrapper` object, which can go by several different names (e.g. `page`, `article`, `category`, `author`, etc). Without this pull request, accessing `url` requires a cumbersome Jinja2 case statement to figure out the class type being written. This pull request puts `url` and `save_as` into the root Jinja2 context given to `render` for relevant generators.