refactor: split single header and meta components into partials

This commit is contained in:
Ben Goldsworthy 2025-01-27 23:34:33 +01:00
parent d0577aec91
commit e6889cabba
No known key found for this signature in database
22 changed files with 742 additions and 406 deletions

View file

@ -0,0 +1,30 @@
{{- /*
Displays an organisation's title.
@params organisation The organisation to display.
@params site_redact The site-level redaction display settings.
*/
-}}
{{ $is_redacted := .organisation.Params.redact }}
{{ $is_site_show_redacted := eq .site_redact "show" }}
{{ $is_site_black_redacted := eq .site_redact "black" }}
{{ $is_hidden := and $is_redacted ( not $is_site_show_redacted ) }}
{{- if $is_hidden -}}
{{- if $is_site_black_redacted -}}
<li>{{- partialCached "redact-black.html" . -}}</li>
{{- end -}}
{{- else -}}
<li>
<a href="{{ .organisation.RelPermalink }}"
>{{ if ( .organisation.Params.markup_title ) }}
{{ .organisation.Params.markup_title | safeHTML }}
{{ else if ( .organisation.Params.titleLang ) }}
{{ partial "text/foreign-text.html" ( dict "original" .organisation.Title "lang" .organisation.Params.titleLang "translation" .organisation.Params.titleTrans ) }}
{{ else }}
{{ .organisation.Title }}
{{ end }}</a
>
</li>
{{- end -}}