fix: harden editorial brand rendering and SEO

This commit is contained in:
pipeline
2026-07-21 20:54:20 +03:00
parent 14d616d1c9
commit 6150ce762d
13 changed files with 158 additions and 52 deletions
+6 -1
View File
@@ -15,6 +15,10 @@
{{- $text := .text | default "Visit Casino" -}}
{{- $style := .style | default "primary" -}}
{{- $size := .size | default "" -}}
{{- $affiliateURL := $brand.affiliateBaseUrl | default "" -}}
{{- $siteURL := strings.TrimSuffix "/" $page.Site.BaseURL -}}
{{- $targetURL := strings.TrimSuffix "/" $affiliateURL -}}
{{- if and $affiliateURL (ne $targetURL $siteURL) -}}
{{- $subid := .subid | default "" -}}
{{- if not $subid -}}
@@ -27,7 +31,7 @@
{{- if not $subid -}}{{- $subid = $page.Type -}}{{- end -}}
{{- if or (eq $subid "_index") (eq $subid "") -}}{{- $subid = "home" -}}{{- end -}}
{{- $href := printf "%s?%s=%s" $brand.affiliateBaseUrl $brand.affiliateSubIdParam $subid -}}
{{- $href := printf "%s?%s=%s" $affiliateURL $brand.affiliateSubIdParam $subid -}}
{{- $classes := "btn-primary" -}}
{{- if eq $style "secondary" -}}{{- $classes = "btn-secondary" -}}{{- end -}}
@@ -37,3 +41,4 @@
{{- with .class -}}{{- $classes = printf "%s %s" $classes . -}}{{- end -}}
<a href="{{ $href }}" class="{{ $classes }}" rel="sponsored nofollow noopener" target="_blank" data-affiliate data-subid="{{ $subid }}">{{ $text }}</a>
{{- end -}}