I am new to Jekyll and would like to create additional variables in a Post Frontmatter:
style:
name: post
img: image_name
When I try to use a variable like title it works
{% page.title %}
But when I try to use another variable
{% if page.img %}
{{ page.img }}
{% else %}
No image
{% endif %}
That returns nil. Even when simply trying to output
{{ page.img }}
Any idea why I can't use my custom variables defined in the frontmatter?
image_name
as expected. Do you have the closing 3 dashes on the front matter? your code works, there is something wrong other than the code itself I think. – Gladdy