Skip to content

Commit

Permalink
Update version banner to point to current page
Browse files Browse the repository at this point in the history
To match google#1054
  • Loading branch information
jlian authored and geriom committed Dec 1, 2022
1 parent 33f3dfe commit 9556244
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion layouts/partials/version-banner.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
{{ $color := "primary" }}
{{ $latest_version := .Site.Params.url_latest_version }}
{{ $current_version := .Site.Params.version }}
{{ $path := "" }}
{{ if .Site.Params.version_menu_pagelinks }}
{{ $path = .Page.RelPermalink }}
{{ end }}
<div class="pageinfo pageinfo-{{ $color }}">
{{ with $current_version }}<p>Version {{ . | 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 }}" target="_blank">latest version</a>.</p>
<a href="{{ $latest_version | safeURL }}{{ $path }}" target="_blank">latest version</a>.</p>
{{ end }}
{{ end }}
</div>
Expand Down

0 comments on commit 9556244

Please sign in to comment.