Search code examples
jekyll

How to add an object into a site variable in Jekyll?


I want to have an object pass as the site variable in my conditional statement.

I have already tried direct implementation... doesn't work.

...
  # I want to replace:
  {% for author in site.research %}
...
  # with:
...
  {% for author in site.{{include.content}} %}
...

Solution

  • {% for author in site[include.content] %} can do the trick.