{{ $full_version := .Page.Params.release }} {{ $parts := split $full_version "." }} {{ $version := printf "%s.%s" (index $parts 0) (index $parts 1) }} {{ $patch := int (index $parts 2) }} {{ $release_name := strings.TrimSuffix ".0" $full_version }} {{ $page_version := int (index $parts 0) }} {{ $page_revision := int (index $parts 1) }} {{ $page_patch := int (index $parts 2) }} {{ $site_parts := split .Site.Data.args.full_version "." }} {{ $site_version := int (index $site_parts 0) }} {{ $site_revision := int (index $site_parts 1) }} {{ $site_patch := int (index $site_parts 2) }} {{ $site_normalized_version := add (add (mul $site_version 1000000) (mul $site_revision 1000)) $site_patch }} {{ $page_normalized_version := add (add (mul $page_version 1000000) (mul $page_revision 1000)) $page_patch }} {{ if gt $page_normalized_version $site_normalized_version }} {{ errorf "Can't have a release note with a greater version then the site's version (%s vs %s)" $full_version $.Site.Data.args.full_version }} {{ end }} {{ $home := .Site.GetPage "home" }} {{ $lang := $home.Lang }} {{ if eq $lang "en" }} {{ $lang = "" }} {{ else }} {{ $lang = "/zh" }} {{ end }} {{/* establish latest corresponding patch release */}} {{ $latest_patch := 0 }} {{ $latest_patch_url := "" }} {{ range $page := .Site.RegularPages }} {{ $release := $page.Params.release }} {{ if $release }} {{ $parts := split $release "." }} {{ $v := printf "%s.%s" (index $parts 0) (index $parts 1) }} {{ $p := int (index $parts 2) }} {{ if eq $version $v }} {{ if gt $p $latest_patch }} {{ $latest_patch = $p }} {{ $latest_patch_url = $page.Permalink }} {{ end }} {{ end }} {{ end }} {{ end }} {{ $latest_full_version := printf "%s.%d" $version $latest_patch }} {{ $release_location := "archive" }} {{ if and .Site.Data.args.preliminary (eq $version .Site.Data.args.version) }} {{ $release_location = "preliminary" }} {{ else if eq $version .Site.Data.versions.main }} {{ $release_location = "main" }} {{ end }}
{{ $change_notes := .Page.GetPage "./change-notes" }} {{ if $change_notes }}
CHANGE NOTES

Get a detailed list of what's changed.

{{ end }} {{ $upgrade_notes := .Page.GetPage "./upgrade-notes" }} {{ if not $upgrade_notes }} {{ $base_version := printf "%v.%v.0" $page_version $page_revision }} {{ range $page := .Site.Pages }} {{ $release := $page.Params.release }} {{ if eq $release $base_version }} {{ $path := printf "/%supgrade-notes" $page.File.Dir }} {{ $upgrade_notes = .Page.GetPage $path }} {{ end }} {{ end }} {{ end }} {{ if $upgrade_notes }}
BEFORE YOU UPGRADE

Things to know and prepare before upgrading.

{{ end }} {{ if eq $release_location "preliminary" }}
DOWNLOAD

Download and install this release.

{{ else }} {{ if ne $latest_full_version $full_version }} {{ .Page.Scratch.Set "needPopper" true }}
DOWNLOAD

Download and install this release.

{{ else }}
DOWNLOAD

Download and install this release.

{{ end }} {{ end }} {{ $doc_link := printf "https://istio.io%s/docs" $lang }} {{ if eq $release_location "archive" }} {{ $doc_link = printf "https://archive.istio.io/v%s" $version }} {{ else if eq $release_location "preliminary" }} {{ $doc_link := printf "https://preliminry.istio.io%s/docs" $lang }} {{ end }}
DOCS

Visit the documentation for this release.

{{ $helm_changes := .Page.GetPage "./helm-changes" }} {{ if $helm_changes }}
HELM CHANGES

Learn about changes in our Helm installation options.

{{ end }} {{ if $patch }} {{ $old_full_version := printf "%v.%d" $version (sub $patch 1) }} {{ $delta_link := printf "https://github.com/istio/istio/compare/%s...%s" $old_full_version $full_version }}
SOURCE CHANGES

Inspect the full set of source code changes.

{{ end }}