Updating archived docs message

This commit is contained in:
Ori Zohar 2021-04-02 11:58:34 -07:00
parent 1bc4172fcd
commit 0c4fab79f0
2 changed files with 17 additions and 1 deletions

View File

@ -138,7 +138,8 @@ github_branch = "v1.0"
# Versioning
version_menu = "v1.0"
version = "v1.0"
archived_version = false
archived_version = true
url_latest_version = "https://docs.dapr.io"
[[params.versions]]
version = "v1.1 (latest)"

View File

@ -0,0 +1,15 @@
<!-- Check the variable that indicates whether this is an archived doc set.
If yes, display a banner. -->
{{ if .Site.Params.archived_version }}
{{ $color := "primary" }}
{{ $latest_version := .Site.Params.url_latest_version }}
{{ $current_version := .Site.Params.version }}
<div class="pageinfo pageinfo-{{ $color }}">
{{ with $current_version }}<p>The documentation you are viewing is for Dapr {{ . | markdownify }}
which is an older version of Dapr.
{{ with $latest_version }}For up-to-date documentation, see the
<a href="{{ $latest_version | safeURL }}" target="_blank">latest version</a>.</p>
{{ end }}
{{ end }}
</div>
{{ end }}