diff --git a/.circleci/config.yml b/.circleci/config.yml index 86cbcaadf..2abe6d66d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,7 +30,7 @@ jobs: - /home/circleci/bin - run: name: Hugo Build - command: $HOME/bin/hugo -v --destination workspace/public + command: $HOME/bin/hugo -v --minify --destination workspace/public - persist_to_workspace: root: workspace paths: diff --git a/data/versions.yaml b/data/versions.yaml index 704caf399..0c28bd5ba 100644 --- a/data/versions.yaml +++ b/data/versions.yaml @@ -1 +1 @@ -latest_version: v2.0 +stable_version: v2.0 diff --git a/layouts/index.html b/layouts/index.html index 951782b89..e2699f29a 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -5,9 +5,9 @@ Welcome to the InfluxDB v2.x documentation

- This page is never actually shown on the live docs since visiting the docs domain will redirect to the latest version. + This page is never actually shown on the live docs since visiting the docs domain will redirect to the latest stable version. Select your desired version from the dropdown above or go straight to the - latest version. + latest stable version.

diff --git a/layouts/partials/article.html b/layouts/partials/article.html index 5f5d5c823..3c19707cf 100644 --- a/layouts/partials/article.html +++ b/layouts/partials/article.html @@ -1,12 +1,12 @@

{{ .Title }}

- {{ partial "article/latest-version.html" . }} + {{ partial "article/stable-version.html" . }} {{ partial "article/enterprise.html" . }} {{ partial "article/cloud.html" . }} {{ .Content }} {{ partial "article/tags.html" . }} - + {{ if in .RelPermalink "/cloud/"}} {{ partial "article/_cloud-feedback.html"}} {{ else }} diff --git a/layouts/partials/article/latest-version.html b/layouts/partials/article/latest-version.html deleted file mode 100644 index 1f75d28e0..000000000 --- a/layouts/partials/article/latest-version.html +++ /dev/null @@ -1,11 +0,0 @@ -{{ $currentVersion := (index (findRE "[^/]+.*?" .RelPermalink) 0) .RelPermalink }} -{{ $latestVersion := $.Site.Data.versions.latest_version }} -{{ $latestVersionURL := replaceRE "[^/]+.*?[0]" $latestVersion .RelPermalink }} -{{ if not (eq $currentVersion $latestVersion) }} -
-

- This page documents an earlier version of InfluxDB. - View the latest version of this page in the InfluxDB {{ $latestVersion }} documentation. -

-
-{{ end }} diff --git a/layouts/partials/article/stable-version.html b/layouts/partials/article/stable-version.html new file mode 100644 index 000000000..32fc319a0 --- /dev/null +++ b/layouts/partials/article/stable-version.html @@ -0,0 +1,18 @@ +{{ $currentVersion := (index (findRE "[^/]+.*?" .RelPermalink) 0) .RelPermalink }} +{{ $stableVersion := $.Site.Data.versions.stable_version }} +{{ $stableVersionURL := replaceRE "[^/]+.*?[0]" $stableVersion .RelPermalink }} +{{ if lt $currentVersion $stableVersion }} +
+

+ This page documents an earlier version of InfluxDB. InfluxDB {{ $stableVersion }} is the latest stable version.
+ View this page in the {{ $stableVersion }} documentation. +

+
+{{ else if gt $currentVersion $stableVersion }} +
+

+ This page documents a pre-release version of InfluxDB. InfluxDB {{ $stableVersion }} is the latest stable version.
+ View this page in the {{ $stableVersion }} documentation. +

+
+{{ end }} diff --git a/layouts/partials/header/canonical.html b/layouts/partials/header/canonical.html index a8b80b86a..e9d8249af 100644 --- a/layouts/partials/header/canonical.html +++ b/layouts/partials/header/canonical.html @@ -1,8 +1,7 @@ {{ $currentVersion := (index (findRE "[^/]+.*?" .RelPermalink) 0) .RelPermalink }} -{{ $latestVersion := $.Site.Data.versions.latest_version }} -{{ $latestPath := replaceRE "[^/]+.*?[0]" $latestVersion .RelPermalink }} -{{ $canonicalURL := print (replaceRE `\/$` "" .Site.BaseURL) (replaceRE "[^/]+.*?[0]" $latestVersion .RelPermalink) }} +{{ $stableVersion := $.Site.Data.versions.stable_version }} +{{ $canonicalURL := print (replaceRE `\/$` "" .Site.BaseURL) (replaceRE "[^/]+.*?[0]" $stableVersion .RelPermalink) }} -{{ if not (eq $currentVersion $latestVersion) }} +{{ if not (eq $currentVersion $stableVersion) }} {{ end }} diff --git a/layouts/partials/topnav.html b/layouts/partials/topnav.html index 47cd83729..e31193e0b 100644 --- a/layouts/partials/topnav.html +++ b/layouts/partials/topnav.html @@ -5,7 +5,7 @@ - Docs + Docs