Comments
HTML comments
Inside templ statements, use HTML comments.
template.templ
templ template() {
<!-- Single line -->
<!--
Single or multiline.
-->
}
Comments are rendered to the template output.
Output
<!-- Single line -->
<!--
Single or multiline.
-->
As per HTML, nested comments are not supported.
Go comments
Outside of templ statements, use Go comments.
package main
// Use standard Go comments outside templ statements.
var greeting = "Hello!"
templ hello(name string) {
<p>{greeting} { name }</p>
}