{{ if ne .CurrentSection.Params.version .Site.Params.latest }}
  {{ $latest_url := replace .Permalink .CurrentSection.Params.version .Site.Params.latest | relURL }}
  <div class="alert alert-primary" role="alert">
    {{ if eq .CurrentSection.Params.version "main" }}
      <p>
        <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
        This is the documentation for the latest development version of Velero. Both code and docs may be
        unstable, and these docs are not guaranteed to be up to date or correct. See the
        <a href="{{ $latest_url }}">latest version</a>.
      </p>
    {{ else if or (in .CurrentSection.Params.version "beta") (in .CurrentSection.Params.version "alpha") (in .CurrentSection.Params.version "rc") (in .CurrentSection.Params.version "pre") }}
      <p>
        <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
        This is the documentation for the latest pre-production version of Velero. Both code and docs may be
        unstable, and these docs only a best-guess effort at being up to date or correct. See the
        <a href="{{ $latest_url }}">latest version</a>.
      </p>
    {{ else }}
      <p>
        <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
        Documentation for version {{ .CurrentSection.Params.version }} is no longer actively maintained.
        The version you are currently viewing is a static snapshot.
        For up-to-date documentation, see the <a href="{{ $latest_url }}">latest version</a>.
      </p>
    {{ end }}
  </div>
{{ end }}