{{ $projects_to_display := .Get "to_display" }} {{/* Fetch last update date from the json file with research projects */}}

Last updated: {{ $.Site.Data.research_projects.last_updated }}

{{/* Make a list of unique funder names, PI affiliations, topics */}} {{ $all_funders := slice }} {{ $all_affiliations := slice }} {{ $all_topics := slice }} {{ range $.Site.Data.research_projects.projects }} {{ if gt (.enddate | time.Format "20060102") (now | time.Format "20060102") }} {{ if .funder }} {{ $all_funders = $all_funders | append .funder }} {{ end }} {{ if .pi_affiliation}} {{ $all_affiliations = $all_affiliations | append .pi_affiliation }} {{ end }} {{ range .topic }} {{ $all_topics = $all_topics | append . }} {{ end }} {{ end }} {{ end }} {{ $funders := $all_funders | uniq }} {{ $affiliations := $all_affiliations | uniq }} {{ $topics := $all_topics | uniq }}
{{ if ne $projects_to_display "all_covid"}}
Topic
{{ range sort $topics }}
{{ end }} {{ end }}
Funder
{{ range sort $funders }}
{{ end }}
PI affiliation
{{ range sort $affiliations }}
{{ end }}
{{ range $ind, $cont := $.Site.Data.research_projects.projects }} {{ if ne $projects_to_display "all_covid"}} {{ if gt (.enddate | time.Format "20060102") (now | time.Format "20060102") }} {{ end }} {{ else }} {{ if in .topic "COVID-19" }} {{ end }} {{ end }} {{ end }}
Project title Funder Topics
{{ if .url }}{{ end }}{{ .project_title }}{{ if .url }}{{ end }}
{{ if or .pi .pi_affiliation }}

{{ if .pi_affiliation }}Host institute: {{ .pi_affiliation }}
{{ end }} {{ if .pi}}Principal investigator: {{ .pi }}{{ end }}

{{ end }}
{{ if and (eq $.Site.Language.LanguageName "Svenska") .funder_sv }}{{ .funder_sv }}{{ else }} {{ .funder }}{{ end }} {{ range .topic }}{{ . }}{{ end }}
{{ if .url }}{{ end }}{{ .project_title }}{{ if .url }}{{ end }}
{{ if or .pi .pi_affiliation }}

{{ if .pi_affiliation }}Host institute: {{ .pi_affiliation }}
{{ end }} {{ if .pi}}Principal investigator: {{ .pi }}{{ end }} {{ end }}

{{ if and (eq $.Site.Language.LanguageName "Svenska") .funder_sv }}{{ .funder_sv }}{{ else }} {{ .funder }}{{ end }} COVID-19