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

View file

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

View file

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

View file

@ -1,23 +1,10 @@
{{- /* {{- /*
Displays an internal link without a title Displays an internal link without a title
@params pc Page context @params . Link.
@params sc Site context
*/ */
-}} -}}
<!-- 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 --> <!-- Rendering -->
<li><a href="{{ . }}">Link</a></li> <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 ) ) ) }} {{ $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 }} {{ with $matched_organisations }}
{{ range . }} {{ 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 }} {{ end }}
{{ else }} {{ else }}
{{ erroridf "missing-organisation" "Could not find organisation %q (%q)" .Title $.sc.File.Path }} {{ erroridf "missing-organisation" "Could not find organisation %q (%q)" .Title $.sc.File.Path }}