diff --git a/assets/sass/style.sass b/assets/sass/style.sass index 7084f812..a7052c7d 100644 --- a/assets/sass/style.sass +++ b/assets/sass/style.sass @@ -66,6 +66,22 @@ $colors: mergeColorMaps(("orange": ($orange, $white)), $colors) margin: 0 auto figcaption +// Deprecation warning +.deprecation-warning + padding: 20px + margin: 20px 0 + background-color: #faf5b6 + color: #000 + +body.td-home .deprecation-warning, body.td-blog .deprecation-warning, body.td-documentation .deprecation-warning + border-radius: 3px + +body.td-home #deprecation-warning + max-width: 1000px + margin-top: 2.5rem + margin-left: auto + margin-right: auto + // Safari-specific attribute .hero display: -webkit-box diff --git a/config.toml b/config.toml index 2f6fdef4..2a0de5d6 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 0195146c..30116b07 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 d706388f..deceeaf4 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 1f19c759..003edfd1 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 aedd9d27..92497bd6 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 13081af0..d8d7e381 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 14296579..e984c87b 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/docs/section.en.html b/layouts/docs/section.en.html index 0380797e..434c9163 100644 --- a/layouts/docs/section.en.html +++ b/layouts/docs/section.en.html @@ -12,6 +12,8 @@
{{ partial "docs/hero.html" . }} + {{ partial "deprecation-warning.html" . }} +
{{ with .Content }} @@ -20,6 +22,7 @@
{{ end }} + {{ if and $isVersionMainPage .Sections }}

Documentation sections diff --git a/layouts/docs/single.en.html b/layouts/docs/single.en.html index 6b1be716..e9054a8a 100644 --- a/layouts/docs/single.en.html +++ b/layouts/docs/single.en.html @@ -10,6 +10,8 @@
{{ partial "docs/hero.html" . }} + {{ partial "deprecation-warning.html" . }} + {{ partial "docs/article.html" . }} {{ partial "footer.html" . }} diff --git a/layouts/index.redirects b/layouts/index.redirects index f730c24b..93904ab4 100644 --- a/layouts/index.redirects +++ b/layouts/index.redirects @@ -1,4 +1,4 @@ {{ $latest := site.Params.versions.latest }} -/docs /docs/v{{ $latest }} -/docs/latest /docs/v{{ $latest }} -/docs/latest/* /docs/v{{ $latest }}/:splat +/docs /docs/{{ $latest }} +/docs/latest /docs/{{ $latest }} +/docs/latest/* /docs/{{ $latest }}/:splat diff --git a/layouts/partials/deprecation-warning.html b/layouts/partials/deprecation-warning.html new file mode 100644 index 00000000..ade9bc72 --- /dev/null +++ b/layouts/partials/deprecation-warning.html @@ -0,0 +1,20 @@ + + +{{ if ne site.Params.versions.latest .CurrentSection.Params.version }} + +{{ $original_version := printf "/%s/" .CurrentSection.Params.version }} +{{ $currentUrl := .Permalink }} +{{ $new_version := printf "/%s/" site.Params.versions.latest }} + +
+
+

+ You are viewing documentation for etcd version: {{ .Param "version" }} +

+

etcd {{ .Param "version" }} documentation is no longer actively maintained. The version you are currently viewing is a static snapshot. For up-to-date documentation, see the latest release, + {{ site.Params.versions.latest }}. +

+
+
+{{ end }} + diff --git a/layouts/partials/docs/hero.html b/layouts/partials/docs/hero.html index f1b8d67f..ca4dc55d 100644 --- a/layouts/partials/docs/hero.html +++ b/layouts/partials/docs/hero.html @@ -1,5 +1,5 @@ {{ $version := index (split .File.Path "/") 1 }} -{{ $latest := printf "v%s" site.Params.versions.latest }} +{{ $latest := printf "%s" site.Params.versions.latest }} {{ $allVersions := site.Params.versions.all }} {{ $versions := (slice) }} {{ $here := .RelPermalink }} @@ -33,8 +33,8 @@
- {{ range $versions }} - {{ $v := printf "v%s" . }} + {{ range .Site.Params.versions.all }} + {{ $v := printf "%s" . }} {{ $isLatest := eq $latest $v }} {{ $href := replace $here $version $v }} diff --git a/layouts/partials/docs/nav-panel.html b/layouts/partials/docs/nav-panel.html index f4cc1576..4748b923 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 91ee3215..ed4e4fb8 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 bc22786d..c85e4ee5 100644 --- a/layouts/partials/home/hero.html +++ b/layouts/partials/home/hero.html @@ -17,7 +17,7 @@