How do you block comment out code in the Pug templating engine?
I know how to comment out a line:
//-doesn't show
but I don't want to have to write in full html comments like so:
<!-- no show -->
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.
As written in the comment documentation, you can either use // which will translate to a HTML comment or //- which won't be visible in the outputted HTML code.
The names of the variables in your Pug file become siteColors and siteNames . To set the entirety of an HTML element equal to a variable, use the equals operator = to do so. If your variable needs to be embedded inline, use bracket syntax #{} to do so.
//- Just indent the comment like normal elements
Just indent your comment like you do other elements.
Just be careful that you have your indention correct or you may comment out more than you intended.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With