added latest version checker and warning

pull/3/head
Scott Anderson 2018-12-31 22:15:06 -07:00
parent ae8880f696
commit 93bc532ad1
2 changed files with 12 additions and 0 deletions

1
data/versions.yaml Normal file
View File

@ -0,0 +1 @@
latest_version: v2.0

View File

@ -0,0 +1,11 @@
{{ $currentVersion := (index (findRE "[^/]+.*?" .RelPermalink) 0) .RelPermalink }}
{{ $latestVersion := $.Site.Data.versions.latest_version }}
{{ $latestVersionURL := replaceRE "[^/]+.*?[0]" $latestVersion .RelPermalink }}
{{ if not (eq $currentVersion $latestVersion) }}
<div class="warn">
<p>
This page documents an earlier version of InfluxDB.
View the latest version of this page in the <a href="{{ $latestVersionURL }}">InfluxDB {{ $latestVersion }}</a> documentation.
</p>
</div>
{{ end }}