It seems odd to me to do things this way, unless we expect to extend this logic to other pages.  

Again--why not do this as template variables?  It seems so much more straightforward and more restricted in the scope of the change.  You've just added code to run on every page, and I can't think of a reason why.