Search code examples
jekyllliquid

How do I use a frontmatter variable as a variable in Jekyll/Liquid?


I tried using square brackets like this:

{{ [my_variable] }}

... which is not working. The square brackets are only working together with other text in the curly brackets:

{{ some_other_text.[my_variable] }}

Thanks!


Solution

  • Solved it with a hook / plugin as described here:

    https://github.com/gemfarmer/jekyll-liquify

    http://acegik.net/blog/ruby/jekyll/plugins/howto-nest-liquid-template-variables-inside-yaml-front-matter-block.html

    ... still wonder why {{ [my_variable] }} is not possible in liquid/jekyll...