Escape character problem

Hello.

I want to generate this html with Hugo.

<html>
  <head>
    <title><%TemplateTag%></title>
  </head>
</html>

So I just wrote the above code to single.html of layouts folder.
Then title’s < changed to &lt;.

<html>
  <head>
    <title>&lt;%TemplateTag%></title>
  </head>
</html>

I also tried {{ "<" | safeHTML }} but I got same result.

How to generate it correctly?

Thanks.

I believe this behavior is a feature of Go HTML templates. Go will not allow you to put unescaped HTML tags inside of the title of an HTML template. I don’t know why they don’t escape the trailing “>”, though. Regardless of how Hugo “sanitizes” the content with safeHTML, it looks like the Go template engine escapes the title content anyway.

I see…
Thank you.