diff --git a/_includes/list_project_team.html b/_includes/list_project_team.html index 77a27093b..9c3088388 100644 --- a/_includes/list_project_team.html +++ b/_includes/list_project_team.html @@ -10,31 +10,21 @@

Team

{%- endif -%} {% for contact in include.team %} - {% assign written = false %} - {% if contact contains "](" %} + {% assign person = site.data.people | find: "shortname", contact %} + + {% if person %} + {%- if inline and person.e-mail -%} + {{ li }} {{person.name}} {{ eli }} + {%- elsif person.website -%} + {{ li }} {{ person.name }} {{ eli }} + {% else %} + {{ li }} {{person.name}} {{ eli }} + {% endif %} {% elsif contact contains "@" %} {{contact}} - {% assign written = true %} - {% else %} - {% for person_hash in site.data.people -%} - {% assign person = person_hash[1] -%} - {% if person.shortname == contact %} - {%- if inline and person.e-mail -%} - {{ li }} {{person.name}} {{ eli }} - {% assign written = true %} - {%- elsif person.website -%} - {{ li }} {{ person.name }} {{ eli }} - {% assign written = true %} - {% else %} - {{ li }} {{person.name}} {{ eli }} - {% assign written = true %} - {% endif %} - {% endif %} - {% endfor %} - {% endif %} - {% unless written %} + {{ else }} {{ li }} {{ contact | markdownify | remove: '

' | remove: '

' }} {{ eli }} - {% endunless %} + {% endif %} {% endfor %} {%- unless include.inline %} diff --git a/_layouts/focus-area.html b/_layouts/focus-area.html index bb9576023..5ec91b69f 100644 --- a/_layouts/focus-area.html +++ b/_layouts/focus-area.html @@ -16,6 +16,26 @@ {% assign page_focus_area = page.name | basename %} {% assign sorted = site.pages | smart_page_sort: "focus-area", page_focus_area %} +{% assign fa_team = sorted | get_set: "team" | sort | key_to_value: site.data.people %} + +{% unless fa_team.empty %} +
+
+ {% for person in fa_team %} +
+ Card image cap + {%- if person.website -%} + {{ person.name }} + {%- else -%} + {{ person.name }} + {%- endif -%} +
+ {% endfor %} +
+
+
+{% endunless %} + {% unless sorted.empty %}

{{ page.short_title | upcase }} Projects


diff --git a/_plugins/smart_sort.rb b/_plugins/smart_sort.rb index 2978479a9..0fe779c7b 100644 --- a/_plugins/smart_sort.rb +++ b/_plugins/smart_sort.rb @@ -7,6 +7,14 @@ def smart_page_sort(input, field, match) input.select { |p| p['pagetype'] == 'project' && p[field].include?(match) } .sort_by { |p| [p['position'] || 0, p['title'].downcase] } end + + def get_set(input, key) + input.flat_map { |p| p[key] || [] }.uniq + end + + def key_to_value(input, hash) + input.map { |k| hash.fetch(k, nil) }.compact + end end end