Closed willkg closed 10 years ago
Breaking this down into steps:
cb_head
, cb_foot
, cb_story
, ... stuff.cb_context_processor
callback that lets plugins add functions and variables to the Jinja2 environment.context_processor
callback.context_processor
callback.This has some interesting ramifications on how plugins work.
For example, the tags plugin used cb_head
and cb_foot
and added a variable that built a list of all the tags for the blog. Instead, it can add an object to the context that has:
I like the new system a lot better.
Plugins to rewrite
For clarification, I folded the interesting bits of readmore into rst_parser and ditched the readmore plugin.
The last one to rewrite is archives. I'm going to close this issue out and open a new issue to merge archives and yeararchives into a datearchives plugin.
Done! Yay!
The jinja2 renderer doesn't do cb_head, cb_foot, cb_story, ... callbacks. Many of the plugins require these to work properly.
They should be updated to add things (variables, functions, ...) to the context so that they can be used in templates.