Omphaloskepsis-2/layouts/partials/single/post-meta/organisations.html

31 lines
1.2 KiB
HTML

{{- /*
Displays the organisations for an item.
@params pc The page context.
@params sc The site context.
*/
-}}
<section
id="post-organisations"
class="article-footer__organisations"
itemprop="articleSection"
>
<h3>Organisations</h3>
<ul>
{{ $all_organisations := partialCached "get_all_organisations.html" .pc }}
<!-- TODO: Replace with hierarchy partial -->
{{- range ( .pc.GetTerms "organisations" ) -}}
{{ $matched_organisations := ( union ( union ( where $all_organisations "Title" ( .Title | plainify ) ) ( where $all_organisations "Params.abbreviation" ( .Title | plainify ) ) ) ( where $all_organisations "Params.fka" ( .Title | plainify ) ) ) }}
{{ with $matched_organisations }}
{{ range . }}
{{ partial "cv/organisation/get-title.html" ( dict "organisation" . "site_redact" $.sc.Site.Params.redact ) .File.Dir }}
{{ end }}
{{ else }}
{{ erroridf "missing-organisation" "Could not find organisation %q (%q)" .Title $.sc.File.Path }}
<li>{{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}</li>
{{ end }}
{{- end -}}
</ul>
</section>