|
40 | 40 | {{- $this_release_date := $this_release.publish_date | time.AsTime }} |
41 | 41 | {{- $this_release_date_string := $this_release_date | time.Format ":date_long" }} |
42 | 42 |
|
43 | | -{{- $this_version_lag := sub $latest_release_minor $this_release_minor }} |
44 | | -{{- $popup_content_prefix := printf "Kubeflow %s was initially released on <strong>%s</strong> and is <strong>%d</strong> minor versions behind the latest release." $version_full $this_release_date_string $this_version_lag }} |
| 43 | +{{- $latest_is_calver := not (strings.HasPrefix $latest_release.tag "v") }} |
| 44 | +{{- $this_is_calver := not (strings.HasPrefix $this_release.tag "v") }} |
| 45 | +{{- $this_version_lag := 0 }} |
| 46 | +{{- if and $latest_is_calver $this_is_calver }} |
| 47 | + {{- /* Both CalVer: compute lag in months */}} |
| 48 | + {{- $this_version_lag = sub (add (mul $latest_release_major 12) $latest_release_minor) (add (mul $this_release_major 12) $this_release_minor) }} |
| 49 | +{{- else if and (not $latest_is_calver) (not $this_is_calver) }} |
| 50 | + {{- /* Both semver: compare minor versions */}} |
| 51 | + {{- $this_version_lag = sub $latest_release_minor $this_release_minor }} |
| 52 | +{{- else }} |
| 53 | + {{- /* Mixed schemes: this is a legacy semver release, latest is CalVer */}} |
| 54 | + {{- $this_version_lag = -1 }} |
| 55 | +{{- end }} |
| 56 | +{{- $popup_content_prefix := "" }} |
| 57 | +{{- if lt $this_version_lag 0 }} |
| 58 | + {{- $popup_content_prefix = printf "Kubeflow %s was initially released on <strong>%s</strong> and is 1 version behind the latest release. This is a legacy semver release; the project has since moved to CalVer versioning." $version_full $this_release_date_string }} |
| 59 | +{{- else }} |
| 60 | + {{- $popup_content_prefix = printf "Kubeflow %s was initially released on <strong>%s</strong> and is <strong>%d</strong> minor versions behind the latest release." $version_full $this_release_date_string $this_version_lag }} |
| 61 | +{{- end }} |
45 | 62 | {{- $popup_content_suffix := "Distributions are supported by their maintainers. Contact the provider for information on support and updates." }} |
46 | 63 |
|
47 | 64 | {{- $button_style := "" }} |
|
0 commit comments