HTML template based on useragent

Are you sure it can’t be done with browse templates? The way I understand the question, they just want to use a different browse template for bots vs. browsers. Since browse supports all standard template actions (plus some others), you can do something like {{if eq (.Header "User-Agent") "user agent here"}}...{{end}}, right?