Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to comment out content in Hugo

Tags:

hugo

How do I comment out content in Hugo?

If I have notes, unfinished thoughts, I'd like to leave them in the .md file but not have them appear in the html.

<!-- tags don't seem to work -- it doesn't even become a html comment, it remains visible text on the page.

like image 299
mjeppesen Avatar asked Jul 20 '17 20:07

mjeppesen


People also ask

How do you comment out something in code?

An HTML comment begins with <! –– and the comment closes with ––> . HTML comments are visible to anyone that views the page source code, but are not rendered when the HTML document is rendered by a browser.

How do you comment multiple lines in markdown?

You can do this (YAML block): ~~~ # This is a # multiline # comment ...


Video Answer


1 Answers

Hugo uses Go templates under the hood, so the comment syntax is {{/* a comment */}}. Anything inside the comment will not be rendered to the resulting HTML files.

Official Hugo comments documentation

like image 161
Henrik Aasted Sørensen Avatar answered Sep 19 '22 21:09

Henrik Aasted Sørensen