Quick assign variables in jekyll.

Square brackets seem to do the job correctly.

Edit 2016-03-08

  • Changed initial text for lower height in preview (blog page).

This is how the projects/index.html page is built:

{%
  include projects.html
  project_title="Current projects"
  status="current"
%}
<div class="spacer"></div>
{%
  include projects.html
  project_title="Past projects"
  status="past"
%}

And this is the basic project.html template:

[...]
  {% for project in site.data.projects.[include.status] %}
  <li>
    <span>
      <a href="{{project.site}}">
        <span>{{ project.name }}</span>
      </a>
      <span>
        {{ project.description }}
      </span>
    </span>
  </li>
  {% endfor %}
[...]

So, a inclusion can have parameters {% include projects.html [...] status="current"%} and you can include them right away with square brackets {% for project in site.data.projects.[include.status] %}.