refactor: split single header and meta components into partials
This commit is contained in:
parent
d0577aec91
commit
e6889cabba
22 changed files with 742 additions and 406 deletions
31
layouts/partials/single/post-meta/organisations.html
Normal file
31
layouts/partials/single/post-meta/organisations.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
{{- /*
|
||||
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>
|
Loading…
Add table
Add a link
Reference in a new issue