<!-- Check the variable that indicates whether this is an archived doc set.
  If yes, display a banner. -->
{{ $latest_version := .Site.Params.url_latest_version }}
{{ $current_version := .Section | printf "/%s" }}

{{ if .FirstSection.Params.prerelease }}
  {{ $color := "primary" }}
  <div class="pageinfo pageinfo-{{ $color }}">
    {{ with $current_version }}<p>Version {{ trim . "/" | markdownify }} of the
      documentation is for the Talos version being developed.
      {{ with $latest_version }}For the latest stable version of Talos, see the
        <a href="{{ $latest_version | safeURL }}">latest version</a>.</p>
      {{ end }}
    {{ end }}
  </div>
{{ else if ne $latest_version $current_version }}
  {{ $color := "primary" }}
  <div class="pageinfo pageinfo-{{ $color }}">
    {{ with $current_version }}<p>Version {{ trim . "/" | markdownify }} of the
      documentation is no longer actively maintained. The site that you are
      currently viewing is an archived snapshot.
      {{ with $latest_version }}For up-to-date documentation, see the
        <a href="{{ $latest_version | safeURL }}">latest version</a>.</p>
      {{ end }}
    {{ end }}
  </div>
{{ end }}
