I shouldn't be building the html title in the template. That should be in the view. I know the error of my ways.