fix: harden editorial brand rendering and SEO
This commit is contained in:
@@ -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 -}}
|
||||
|
||||
Reference in New Issue
Block a user