Check if var exists before include tag (#7530)

Merge pull request 7530
This commit is contained in:
Jörg Steinsträter 2019-02-15 15:20:12 +01:00 committed by jekyllbot
parent 55f0980716
commit f1777adae9
1 changed files with 3 additions and 1 deletions

View File

@ -48,7 +48,9 @@ You could then reference that variable in your include:
{% raw %}
```liquid
{% include {{ page.my_variable }} %}
{% if page.my_variable %}
{% include {{ page.my_variable }} %}
{% endif %}
```
{% endraw %}