code: def render_publ_template(template, **kwargs):
      
      text = render_template(
          template.filename,
          template=template,
          image=image_function(
              template=template,
              category=kwargs.get('category'),
              entry=kwargs.get('entry')),
          **kwargs
      )
  
      return text, caching.get_etag(text)
docs: Render out a template, providing the image function based on the args.
  
      Returns tuple of (rendered text, etag)