When writing comments in your Sightly HTL file, it’s best practice not to use HTML comments, but to use the sightly, HTML Template Language.
1. HTL comments are not evaluated and returned back as an empty string in the server-side rendered results.
This is best practice when developers are including some comments for other developers in their organization.
Sightly HTL comments combine HTML and JavaScript multi-line comments: <!–/* */–>
1 2 3 4 5 6 7 8 9 10 11 | <!--/* The content of this comment will be removed from the output. */--> // output: "" <!--/* The content of this comment will be removed from the output. The content of this comment will be removed from the output. The content of this comment will be removed from the output. The content of this comment will be removed from the output. Page title: ${currentPage.jcr:title} */--> // output: "" |
2. Standard HTML comments, the comments are evaluated and are server-side rendered with the expected results.
1 2 3 | <!-- Page title: ${currentPage.jcr:title} --> //output <!-- Page title: Home Page --> |
Available for HTML Template Language Specification 1.4
Release Date: 18 June 2018
Reference: https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md