Comments

Comments

Buffered comments look the same as single-line JavaScript comments. They act sort of like markup tags, producing HTML comments in the rendered page.

Like tags, buffered comments must appear on their own line.

// just some paragraphs
p foo
p bar
<!-- just some paragraphs-->
<p>foo</p>
<p>bar</p>

Pug also supports unbuffered comments. Simply add a hyphen (-) to the start of the comment.

These are only for commenting on the Pug code itself, and do not appear in the rendered HTML.

//- will not output within markup
p foo
p bar
<p>foo</p>
<p>bar</p>

Block Comments

Block comments work, too:

body
  //-
    Comments for your template writers.
    Use as much text as you want.
  //
    Comments for your HTML readers.
    Use as much text as you want.
<bo