How to add comments in Jade or Pug templates?

Sometimes, we want to add comments in Jade or Pug templates.

In this article, we’ll look at how to add comments in Jade or Pug templates.

How to add comments in Jade or Pug templates?

To add comments in Jade or Pug templates, we can add //- before our comment.

For instance, we write

doctype html

html(lang='en')
    body
        //- 
            This should be a comment

to add the This should be a comment comment in the body element.

Conclusion

To add comments in Jade or Pug templates, we can add //- before our comment.