Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comment out an include statement inside an HTML file using Jekyll

Is there a way to comment out an include statement inside an HTML file using Jekyll?

For example I have this inside one of my HTML files that I'd like to temporarily comment out. Standard HTML comment doesn't seem to work.

{% include navbar.html %}            
like image 618
Amit Avatar asked Jan 16 '15 01:01

Amit


People also ask

How do you comment out a statement in HTML?

In HTML, a comment is text enclosed within < ! ╌ ╌> tags. This syntax tells the browser that they are comments and should not be rendered on the front end. Thanks to the comments tag, you can leave notes to remind yourself where you left off in the build process.

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.

What tag should be used if you want to include a comment section in your form?

To use the HTML comment tag, place your insertion mark cursor at the location in the HTML code where you want to type the comment. Then type the start of the comment tag by typing <!


2 Answers

{% comment %} {% include navbar.html %} {% endcomment %} 
like image 62
David Jacquel Avatar answered Oct 18 '22 09:10

David Jacquel


Jekyll uses the Liquid templating system. So whatever works for Liquid works for Jekyll.

{% comment %} this is commented out {% endcomment %} 

https://help.shopify.com/themes/liquid/tags/theme-tags#comment

like image 35
mccambridge Avatar answered Oct 18 '22 08:10

mccambridge