Categories
JavaScript Answers

How to add comments in Jade or Pug templates?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *