mirror of
https://github.com/siderolabs/sidero.git
synced 2026-05-05 20:36:29 +02:00
This PR is a copy of two PRs from talos: https://github.com/siderolabs/talos/pull/5389/files https://github.com/siderolabs/talos/pull/5391/files It ensures that the banner is shown if the user isn't viewing the latest sidero docs. This actually already was working but the banner html was in an incorrect spot, so moved that to match what's seen in Talos repo. Also adds the canonical links for search engines to update their indexes. Signed-off-by: Spencer Smith <spencer.smith@talos-systems.com>
28 lines
1.2 KiB
HTML
28 lines
1.2 KiB
HTML
<!-- 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" }}
|
|
{{ $latest_doc := partial "doc_latest_version.html" . }}
|
|
|
|
{{ if .FirstSection.Params.prerelease }}
|
|
{{ $color := "info" }}
|
|
<div class="version-banner pageinfo pageinfo-{{ $color }}">
|
|
{{ with $current_version }}<p>Version {{ trim . "/" | markdownify }} of the
|
|
documentation is for the Sidero Metal version being developed.
|
|
{{ with $latest_version }}For the latest stable version of Sidero Metal, see the
|
|
<a href="{{ $latest_doc | safeURL }}">latest version</a>.</p>
|
|
{{ end }}
|
|
{{ end }}
|
|
</div>
|
|
{{ else if ne $latest_version $current_version }}
|
|
{{ $color := "warning" }}
|
|
<div class="version-banner 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_doc | safeURL }}">latest version</a>.</p>
|
|
{{ end }}
|
|
{{ end }}
|
|
</div>
|
|
{{ end }} |