From 4ee4190295f1989a8bc050196dec6ad88aad14ab Mon Sep 17 00:00:00 2001 From: Nate W <4453979+nate-double-u@users.noreply.github.com> Date: Tue, 29 Dec 2020 18:05:16 -0800 Subject: [PATCH] Fix multi-version navigation Updating version selector dropdown * Allowing switching between historical versions of the same page Removing hardcoded "v" from version code * Potentially, not all versions will need to start with "v" Updating hero.html * correcting "Docs" button size fixes: https://github.com/etcd-io/website/issues/82 Signed-off-by: Nate W <4453979+nate-double-u@users.noreply.github.com> --- config.toml | 4 ++-- content/docs/v2/_index.md | 2 ++ content/docs/v3.1.12/_index.md | 4 +++- content/docs/v3.2.17/_index.md | 2 ++ content/docs/v3.3.12/_index.md | 2 ++ content/docs/v3.3.13/_index.md | 2 ++ content/docs/v3.4.0/_index.md | 2 ++ layouts/partials/docs/nav-panel.html | 24 +++++++++++++----------- layouts/partials/docs/navbar.html | 2 +- layouts/partials/home/hero.html | 2 +- layouts/shortcodes/versions.html | 4 ++-- 11 files changed, 32 insertions(+), 18 deletions(-) diff --git a/config.toml b/config.toml index 2f6fdef49..2a0de5d67 100644 --- a/config.toml +++ b/config.toml @@ -40,8 +40,8 @@ Latency from the etcd leader is the most important metric to track and the built unsafe = true [params.versions] -latest = "3.4.0" -all = ["3.4.0", "3.3.13", "3.3.12", "3.2.17", "3.1.12", "2"] +latest = "v3.4.0" +all = ["v3.4.0", "v3.3.13", "v3.3.12", "v3.2.17", "v3.1.12", "v2"] [params.logos] hero = "https://raw.githubusercontent.com/cncf/artwork/master/projects/etcd/horizontal/white/etcd-horizontal-white.png" diff --git a/content/docs/v2/_index.md b/content/docs/v2/_index.md index 0195146ca..30116b078 100644 --- a/content/docs/v2/_index.md +++ b/content/docs/v2/_index.md @@ -1,5 +1,7 @@ --- title: etcd version 2 +cascade: + version: v2 --- These docs cover everything from setting up and running an etcd cluster to using etcd in your applications. Improvements to these docs are encouraged through [pull requests](https://help.github.com/en/articles/about-pull-requests) to the [etcd project](https://github.com/etcd-io/etcd) on GitHub. diff --git a/content/docs/v3.1.12/_index.md b/content/docs/v3.1.12/_index.md index d706388fd..deceeaf42 100644 --- a/content/docs/v3.1.12/_index.md +++ b/content/docs/v3.1.12/_index.md @@ -1,5 +1,7 @@ --- title: etcd version 3.1.12 +cascade: + version: v3.1.12 --- -These docs cover everything from setting up and running an etcd cluster to using etcd in your applications. Improvements to these docs are encouraged through [pull requests](https://help.github.com/en/articles/about-pull-requests) to the [etcd project](https://github.com/etcd-io/etcd) on GitHub. \ No newline at end of file +These docs cover everything from setting up and running an etcd cluster to using etcd in your applications. Improvements to these docs are encouraged through [pull requests](https://help.github.com/en/articles/about-pull-requests) to the [etcd project](https://github.com/etcd-io/etcd) on GitHub. diff --git a/content/docs/v3.2.17/_index.md b/content/docs/v3.2.17/_index.md index 1f19c7593..003edfd16 100644 --- a/content/docs/v3.2.17/_index.md +++ b/content/docs/v3.2.17/_index.md @@ -1,5 +1,7 @@ --- title: etcd version 3.2.17 +cascade: + version: v3.2.17 --- These docs cover everything from setting up and running an etcd cluster to using etcd in your applications. Improvements to these docs are encouraged through [pull requests](https://help.github.com/en/articles/about-pull-requests) to the [etcd project](https://github.com/etcd-io/etcd) on GitHub. diff --git a/content/docs/v3.3.12/_index.md b/content/docs/v3.3.12/_index.md index aedd9d279..92497bd67 100644 --- a/content/docs/v3.3.12/_index.md +++ b/content/docs/v3.3.12/_index.md @@ -1,5 +1,7 @@ --- title: etcd version 3.3.12 +cascade: + version: v3.3.12 --- These docs cover everything from setting up and running an etcd cluster to using etcd in your applications. Improvements to these docs are encouraged through [pull requests](https://help.github.com/en/articles/about-pull-requests) to the [etcd project](https://github.com/etcd-io/etcd) on GitHub. diff --git a/content/docs/v3.3.13/_index.md b/content/docs/v3.3.13/_index.md index 13081af00..d8d7e381e 100644 --- a/content/docs/v3.3.13/_index.md +++ b/content/docs/v3.3.13/_index.md @@ -1,3 +1,5 @@ --- title: etcd version 3.3.13 +cascade: + version: v3.3.13 --- diff --git a/content/docs/v3.4.0/_index.md b/content/docs/v3.4.0/_index.md index 142965790..e984c87ba 100644 --- a/content/docs/v3.4.0/_index.md +++ b/content/docs/v3.4.0/_index.md @@ -1,5 +1,7 @@ --- title: etcd version 3.4.0 +cascade: + version: v3.4.0 --- These docs cover everything from setting up and running an etcd cluster to using etcd in applications. Improvements to these docs are encouraged through [pull requests](https://help.github.com/en/articles/about-pull-requests) to the [etcd project](https://github.com/etcd-io/etcd) on GitHub. diff --git a/layouts/partials/docs/nav-panel.html b/layouts/partials/docs/nav-panel.html index f4cc15765..4748b9236 100644 --- a/layouts/partials/docs/nav-panel.html +++ b/layouts/partials/docs/nav-panel.html @@ -3,7 +3,6 @@ {{ $editUrl := printf "https://github.com/etcd-io/website/edit/master/content/%s" .File.Path }} {{ $latest := site.Params.versions.latest }} {{ $ghUrl := printf "https://github.com/etcd-io/etcd/releases/tag/v%s" $latest }} -{{ $versions := site.Params.versions.all }} {{ $version := index (split .Path "/") 1 }} {{ $allDocs := where site.Sections "Section" "docs" }} {{ $currentUrl := .RelPermalink }} @@ -31,19 +30,22 @@ + diff --git a/layouts/partials/docs/navbar.html b/layouts/partials/docs/navbar.html index 91ee32156..ed4e4fb8c 100644 --- a/layouts/partials/docs/navbar.html +++ b/layouts/partials/docs/navbar.html @@ -21,7 +21,7 @@ Home - + Docs home diff --git a/layouts/partials/home/hero.html b/layouts/partials/home/hero.html index bc22786d7..c85e4ee5c 100644 --- a/layouts/partials/home/hero.html +++ b/layouts/partials/home/hero.html @@ -17,7 +17,7 @@
- + diff --git a/layouts/shortcodes/versions.html b/layouts/shortcodes/versions.html index e1eb29f0b..2c38b8c33 100644 --- a/layouts/shortcodes/versions.html +++ b/layouts/shortcodes/versions.html @@ -2,8 +2,8 @@