<!--
Next let’s get into some liquid logic statements to control whether the h1 is output on the page. We’ll add a new variable to the front matter called show_heading and initalize it to true. Then we’ll surround the h1 in an if statement to check if show_heading is true.
-->
---
heading: I like cupcakes
show_heading: true
---
{% if page.show_heading %}
<h1>{{ page.heading | upcase | truncate: 8 }}</h1>
{% endif %}
<!--
We can also add an elsif to the if statement to check other conditions. So if page.show_heading is false we’ll check if page.heading contains the word “cupcake”, if it does then we’ll output “I want cupcakes”, if it doesn’t we’ll have output I don’t want cupcakes.
-->
---
heading: I like cupcakes
show_heading: false
---
{% if page.show_heading %}
<h1>{{ page.heading | upcase | truncate: 8 }}</h1>
{% elsif page.heading contains "cupcake" %}
<h1>I want cupcakes</h1>
{% else %}
<h1>I don't want cupcakes</h1>
{% endif %}