Back to Yugabyte Db

Earlier Version Warning

docs/layouts/_partials/earlier-version-warning.html

2026.1.0.0-b253.2 KB
Original Source

{{ $docVersion := $.Scratch.Get "docVersion" }} {{ $urlArray := split (urls.Parse .Permalink).Path "/" }} {{ $previewUrl := path.Join "preview" (after 2 $urlArray) }} {{ $previewUrl = add (add "/" $previewUrl) "/" }} {{ $stableUrl := path.Join "stable" (after 2 $urlArray) }} {{ $stableUrl = add (add "/" $stableUrl) "/" }} {{ $previewVersion := "" }} {{ $stableVersion := "" }} {{ $previewBehindStable := false }} {{ $fullpath := printf "%s" .Page.File.Path}} {{ $pathsplit := after 1 (split $fullpath "/")}} {{/** Keep track of whether preview version exists for this file **/}} {{ $previewPath := path.Join "content/preview" $pathsplit }} {{ $previewExists := fileExists $previewPath }} {{/** Keep track of whether stable version exists for this file **/}} {{ $stablePath := path.Join "content/stable" $pathsplit }} {{ $stableExists := fileExists $stablePath }} {{/* warnf "%s(%s) - %s(%s)" $previewPath $previewExists $stablePath $stableExists */}} {{/** Identify is preview is behind stable and which versions are preview and stable **/}} {{ range .Site.Data.currentVersions.dbVersions }} {{- if eq .alias "stable" -}} {{ $stableVersion = .series -}} {{- if in .PreviewBehindStable true -}} {{ $previewBehindStable = true }} {{- end -}} {{- else if eq .alias "preview" -}} {{- $previewVersion = .series -}} {{- end -}} {{- end -}} {{/** Do nothing if this is the latest stable and preview is behind stable **/}} {{- if not (and (eq $docVersion "stable") $previewBehindStable) -}} {{ range .Site.Data.currentVersions.dbVersions }} {{- if or (eq $docVersion .series) (eq $docVersion .alias) -}} {{/** for LTS and STS **/}} {{- if or (eq .isLTS true) (eq .isSTS true) -}} {{/** Do nothing if preview does not exist for this file **/}} {{- if $previewExists -}}

{{- readFile "static/icons/callout/release.svg" | safeHTML -}}

This page documents a stable (production) version.{{ $docVersion }} {{- if eq .isLTS true -}} LTS {{- else if eq .isSTS true -}} STS {{- end -}}

For testing and development with the latest features, use the preview version ({{ $previewVersion }}). {{- if not (eq .alias "stable") -}}
For the latest stable version, see {{ $stableVersion }}. {{- end -}}

{{- end -}} {{- else if eq .alias "preview" -}} {{/** If a stable page does not exist, this is an unversioned page!!!! **/}} {{- if $stableExists -}}

{{- readFile "static/icons/callout/release.svg" | safeHTML -}}

This page documents a preview version.{{ $previewVersion }} Preview

Preview includes features under active development and is for development and testing only.
For production, use the latest stable version ({{ $stableVersion }}).

{{- end -}} {{- else -}} {{- if and $previewBehindStable $stableExists }}

{{- readFile "static/icons/callout/release.svg" | safeHTML -}}

This page documents an earlier version.{{ $docVersion }}

Go to the stable version ({{ $stableVersion }}).

{{- else if $previewExists -}}

{{- readFile "static/icons/callout/release.svg" | safeHTML -}}

This page documents an earlier version.{{ $docVersion }}

Go to the preview version ({{ $previewVersion }}).

{{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}}