fix: links

This commit is contained in:
Ben Goldsworthy 2025-07-17 19:05:06 +02:00
parent a2a1dd2a7c
commit 28f0199644
No known key found for this signature in database
5 changed files with 6 additions and 18 deletions

View file

@ -1,6 +1,7 @@
{{- /*
Displays an organisation's title.
@params pc The page context.
@params organisation The organisation to display.
@params site_redact The site-level redaction display settings.
*/
@ -19,7 +20,7 @@
<li>
<a href="{{ .organisation.RelPermalink }}"
>{{ if ( .organisation.Params.markup_title ) }}
{{ .organisation.Params.markup_title | safeHTML }}
{{ .organisation.Params.markup_title | $.pc.Page.RenderString | safeHTML }}
{{ else if ( .organisation.Params.titleLang ) }}
{{ partial "text/foreign-text.html" ( dict "original" .organisation.Title "lang" .organisation.Params.titleLang "translation" .organisation.Params.titleTrans ) }}
{{ else }}

View file

@ -34,7 +34,7 @@
{{ end }}
{{- partial "single/main-body/links/link/title-link.html" ( $params | merge ( dict "title" .title "link" .link ) ) }}
{{ else }}
{{- partial "single/main-body/links/link/basic-link.html" $params }}
{{- partial "single/main-body/links/link/basic-link.html" . }}
{{ end }}
{{- end -}}
</ul>

View file

@ -40,7 +40,7 @@
{{- partial "single/main-body/links/link/title-link.html" ( $params | merge ( dict "title" .title "link" .link ) ) }}
{{- end -}}
{{ else }}
{{- partial "single/main-body/links/link/basic-link.html" $params }}
{{- partial "single/main-body/links/link/basic-link.html" . }}
{{ end }}
{{- end -}}
</ul>

View file

@ -1,23 +1,10 @@
{{- /*
Displays an internal link without a title
@params pc Page context
@params sc Site context
@params . Link.
*/
-}}
<!-- Validation -->
{{- if ( not ( isset . "sc" ) ) -}}
{{- errorf "No site context received" -}}
{{- end -}}
{{- if ( not ( isset . "pc" ) ) -}}
{{- errorf "No page context received (%q)" .sc.Page.File.Dir -}}
{{- end -}}
<!-- Rendering -->
<li><a href="{{ . }}">Link</a></li>

View file

@ -20,7 +20,7 @@
{{ $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 }}
{{ partial "cv/organisation/get-title.html" ( dict "pc" $.pc "organisation" . "site_redact" $.sc.Site.Params.redact ) .File.Dir }}
{{ end }}
{{ else }}
{{ erroridf "missing-organisation" "Could not find organisation %q (%q)" .Title $.sc.File.Path }}