updated token-link shortcode to use local scratch
parent
e6f53d025e
commit
11541e912b
|
|
@ -1,4 +1,4 @@
|
||||||
|
{{- $s := newScratch -}}
|
||||||
{{- $productPathData := split .Page.RelPermalink "/" -}}
|
{{- $productPathData := split .Page.RelPermalink "/" -}}
|
||||||
{{- $product := index $productPathData 1 -}}
|
{{- $product := index $productPathData 1 -}}
|
||||||
{{- $version := index $productPathData 2 -}}
|
{{- $version := index $productPathData 2 -}}
|
||||||
|
|
@ -9,15 +9,15 @@
|
||||||
{{- $hasDescriptor := ne $descriptor "" -}}
|
{{- $hasDescriptor := ne $descriptor "" -}}
|
||||||
{{- $coreDescriptorBlacklist := slice "resource" "database" -}}
|
{{- $coreDescriptorBlacklist := slice "resource" "database" -}}
|
||||||
{{- $enterpriseDescriptorBlacklist := slice "operator" -}}
|
{{- $enterpriseDescriptorBlacklist := slice "operator" -}}
|
||||||
{{- .Store.Set "showDescriptor" $hasDescriptor -}}
|
{{- $s.Set "showDescriptor" $hasDescriptor -}}
|
||||||
{{- if (eq $version "core") -}}
|
{{- if (eq $version "core") -}}
|
||||||
{{- if and $hasDescriptor (in $coreDescriptorBlacklist $descriptor) -}}
|
{{- if and $hasDescriptor (in $coreDescriptorBlacklist $descriptor) -}}
|
||||||
{{- .Store.Set "showDescriptor" false -}}
|
{{- $s.Set "showDescriptor" false -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- else if (eq $version "enterprise") -}}
|
{{- else if (eq $version "enterprise") -}}
|
||||||
{{- if and $hasDescriptor (in $enterpriseDescriptorBlacklist $descriptor) -}}
|
{{- if and $hasDescriptor (in $enterpriseDescriptorBlacklist $descriptor) -}}
|
||||||
{{- .Store.Set "showDescriptor" false -}}
|
{{- $s.Set "showDescriptor" false -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $showDescriptor := .Store.Get "showDescriptor" -}}
|
{{- $showDescriptor := $s.Get "showDescriptor" -}}
|
||||||
[{{ if $showDescriptor }}{{ $descriptor }} {{ end }}token]({{ $renderedLink }})
|
[{{ if $showDescriptor }}{{ $descriptor }} {{ end }}token]({{ $renderedLink }})
|
||||||
Loading…
Reference in New Issue