fix: harden editorial brand rendering and SEO
This commit is contained in:
@@ -6,21 +6,27 @@
|
||||
{{- $variant := .variant | default "full" -}}
|
||||
{{- $brand := $page.Site.Data.brand -}}
|
||||
{{- $locales := $page.Site.Data.locales -}}
|
||||
{{- $currentLocale := $page.Language.LanguageCode | default $brand.defaultLocale -}}
|
||||
{{- $currentLocale := $brand.defaultLocale -}}
|
||||
{{- range $brand.supportedLocales -}}
|
||||
{{- if or (eq . $page.Language.LanguageCode) (hasPrefix . (printf "%s-" $page.Language.Lang)) -}}{{- $currentLocale = . -}}{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $default := "" -}}
|
||||
{{- with where $locales "locale" $currentLocale -}}{{- $default = index . 0 -}}{{- end -}}
|
||||
{{- $age := $brand.ageRestrictionDefault -}}
|
||||
{{- $orgName := "your national support service" -}}
|
||||
{{- $orgUrl := "#" -}}
|
||||
{{- $orgPhone := "" -}}
|
||||
{{- with $default -}}
|
||||
{{- $age = .ageRestriction -}}
|
||||
{{- $orgName = .responsibleGamblingOrgName -}}
|
||||
{{- $orgUrl = .responsibleGamblingUrl -}}
|
||||
{{- $orgPhone = .responsibleGamblingPhone | default "" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if eq $variant "compact" -}}
|
||||
<p>{{ printf (i18n "rgCompactIntro") $age }}</p>
|
||||
<p class="mt-2">{{ i18n "rgNeedHelp" }} <a data-rg-link href="{{ $orgUrl }}" target="_blank" rel="noopener nofollow" class="font-semibold text-white underline"><span data-rg-name>{{ $orgName }}</span></a>.</p>
|
||||
{{- with $orgPhone }}<p class="mt-2">Free helpline: <a href="tel:{{ replace . " " "" }}" class="font-semibold text-white underline">{{ . }}</a>.</p>{{ end -}}
|
||||
{{- else -}}
|
||||
<div class="prose-content">
|
||||
<p>
|
||||
@@ -52,7 +58,7 @@
|
||||
<tr>
|
||||
<td>{{ .label | default .locale }}</td>
|
||||
<td>{{ .ageRestriction }}+</td>
|
||||
<td><a href="{{ .responsibleGamblingUrl }}" target="_blank" rel="noopener nofollow">{{ .responsibleGamblingOrgName }}</a></td>
|
||||
<td><a href="{{ .responsibleGamblingUrl }}" target="_blank" rel="noopener nofollow">{{ .responsibleGamblingOrgName }}</a>{{ with .responsibleGamblingPhone }}<br><a href="tel:{{ replace . " " "" }}">{{ . }}</a>{{ end }}</td>
|
||||
</tr>
|
||||
{{- end -}}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user