improve renderings

This commit is contained in:
Ben Goldsworthy 2025-03-02 22:41:10 +01:00
parent 4cd64207fe
commit 0a24223fe8
No known key found for this signature in database
8 changed files with 175 additions and 113 deletions

View file

@ -29,13 +29,11 @@
{{- end -}}
{{- else -}}
{{- if .Params.featured_image -}}
<img class="organisation-table__logo" loading="lazy" src="
{{- if .Resources.GetMatch .Params.featured_image -}}
{{- ( .Resources.GetMatch .Params.featured_image ).RelPermalink -}}
{{- with .Resources.GetMatch .Params.featured_image -}}
<img class="organisations-table__logo" loading="lazy" src="{{- .RelPermalink -}}" {{ with .Params.bg }}style="background-color: {{ . }}"{{ end }}>
{{- else -}}
{{- .Params.featured_image -}}
<img class="organisations-table__logo" loading="lazy" src="{{- .Params.featured_image -}}">
{{- end -}}
">
{{- end -}}
{{- end -}}
</td>
@ -48,7 +46,7 @@
{{- else -}}
<a href="{{ .RelPermalink }}">
{{- if .Params.TitleLang -}}<i lang="{{ .Params.TitleLang }}" title="{{ .Params.TitleTrans }}"}>{{- end -}}
{{- with .Params.markup_title -}}{{- . | safeHTML -}}{{- else -}}{{- $organisation_title | safeHTML -}}{{- end -}}
{{- with .Params.markup_title -}}{{- . | $.Page.RenderString -}}{{- else -}}{{- $organisation_title | $.Page.RenderString -}}{{- end -}}
{{- if .Params.TitleLang -}}</i>{{- end -}}
</a>
{{- end -}}

View file

@ -1,22 +1,18 @@
{{- if ( not ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) ) -}}
<li class="hierarchy-item hierarchy-item--child">
<li class="hierarchy-item hierarchy-item--child">
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
{{- if ( eq $.Site.Params.redact "black" ) -}}
{{- partialCached "redact-black.html" . -}}
{{- end -}}
{{- if ( eq $.Site.Params.redact "black" ) -}}
{{- partialCached "redact-black.html" . -}}
{{- end -}}
{{- else -}}
<a href="{{ .RelPermalink }}">
{{- with .Params.markup_title }}
{{- . | safeHTML -}}
{{- else -}}
{{- .Title | safeHTML -}}
{{- end -}}
</a>
{{- range .Sections -}}
<ul>
{{- partialCached "cv/organisations/recursive-children.html" . .Title -}}
</ul>
{{- end -}}
<a href="{{ .RelPermalink }}">
{{ default .Title .Params.markup_title | .Page.RenderString }}
</a>
{{- range .Sections -}}
<ul>
{{- partialCached "cv/organisations/recursive-children.html" . .Title -}}
</ul>
{{- end -}}
{{- end -}}
</li>
</li>
{{- end -}}