updated token-link shortcode to use local scratch
parent
e6f53d025e
commit
11541e912b
|
|
@ -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 }})
|
||||
Loading…
Reference in New Issue