Liquid tag to exclude specific pages from loading an include

I have the following partial that I would like to include on certain pages of my site based on page title. What is the proper way to say “if the page title is ‘this’ or ‘that’ render the include”?

{% if page.title != contains "Foo" or "Bar" %}
       {% include about.html %}
{% endif %}

I assumed it was simply the “or” operator, but alas, this does not work.

I think you need to do the comparison again after the or - as you have it is just or Bar - Bar what?

1 Like

Playing around with this a bit, I found that unless will do the job. You are correct that it required me to do the comparison over again for each item.