Skip to content

Latest commit

 

History

History
66 lines (59 loc) · 1.73 KB

programs.md

File metadata and controls

66 lines (59 loc) · 1.73 KB
layout title
page
Grants by Program

{% comment %} Code adapted from https://codinfox.github.io/dev/2015/03/06/use-tags-and-categories-in-your-jekyll-based-github-pages/ {% endcomment %}

{% comment %}

Collect and sort programs and display tags

{% endcomment %}

{% assign programs = "" %} {% for grant in site.grants %} {% assign program = grant.funder | append: ' - ' %} {% if grant.program != nil %} {% assign program = program | append: grant.program | join:'|' | append:'|' %} {% else %} {% assign program = program | append: '(N/A)' | join:'|' | append:'|' %} {% endif %} {% unless programs contains program %} {% assign programs = programs | append:program %} {% endunless %} {% endfor %} {% assign programs = programs | split:'|' | sort %}

{% for program in programs %} {{ program }} {% endfor %}

{% comment %}

List all grants by program

{% endcomment %}

{% for program in programs %}

{{ program }}

    {% for grant in site.grants %} {% assign myprogram = grant.funder | append: ' - ' %} {% if grant.program != nil %} {% assign myprogram = myprogram | append: grant.program %} {% else %} {% assign myprogram = myprogram | append: '(N/A)' %} {% endif %} {% if myprogram == program %}
  • {{ grant.title }} {{ grant.author }}, {{ grant.year }}, {{ grant.status }}
  • {% endif %} {% endfor %}
{% endfor %}