updated token-link shortcode to use local scratch

pull/6011/head
Scott Anderson 2025-04-22 15:07:50 -06:00
parent e6f53d025e
commit 11541e912b
1 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
{{- $s := newScratch -}}
{{- $productPathData := split .Page.RelPermalink "/" -}}
{{- $product := index $productPathData 1 -}}
{{- $version := index $productPathData 2 -}}
@ -9,15 +9,15 @@
{{- $hasDescriptor := ne $descriptor "" -}}
{{- $coreDescriptorBlacklist := slice "resource" "database" -}}
{{- $enterpriseDescriptorBlacklist := slice "operator" -}}
{{- .Store.Set "showDescriptor" $hasDescriptor -}}
{{- $s.Set "showDescriptor" $hasDescriptor -}}
{{- if (eq $version "core") -}}
{{- if and $hasDescriptor (in $coreDescriptorBlacklist $descriptor) -}}
{{- .Store.Set "showDescriptor" false -}}
{{- $s.Set "showDescriptor" false -}}
{{- end -}}
{{- else if (eq $version "enterprise") -}}
{{- if and $hasDescriptor (in $enterpriseDescriptorBlacklist $descriptor) -}}
{{- .Store.Set "showDescriptor" false -}}
{{- $s.Set "showDescriptor" false -}}
{{- end -}}
{{- end -}}
{{- $showDescriptor := .Store.Get "showDescriptor" -}}
{{- $showDescriptor := $s.Get "showDescriptor" -}}
[{{ if $showDescriptor }}{{ $descriptor }} {{ end }}token]({{ $renderedLink }})