diff --git a/layouts/docs/single.html b/layouts/docs/single.html index 514bcd1bd..5c9697bd5 100644 --- a/layouts/docs/single.html +++ b/layouts/docs/single.html @@ -1,3 +1,24 @@ +{{ $disabled := or (hasPrefix .RelPermalink "/zh/docs/v3.3") + (hasPrefix .RelPermalink "/zh/docs/v3.4") + (hasPrefix .RelPermalink "/zh/docs/v4.1") + (hasPrefix .RelPermalink "/docs/v3.3") + (hasPrefix .RelPermalink "/docs/v3.4") + (hasPrefix .RelPermalink "/docs/v4.1") }} + +{{ if $disabled }} + + + + + + + + + + + {{ return }} +{{ end }} + diff --git a/netlify.toml b/netlify.toml index 5baf81610..166866126 100644 --- a/netlify.toml +++ b/netlify.toml @@ -28,3 +28,17 @@ status = 301 force = true +[[redirects]] + from = "^/(zh/)?docs/(v3\\.3|v3\\.4|v4\\.1)(/.*)?$" + to = "/404.html" + status = 404 + force = true + conditions = { Role = "all" } + +[[headers]] + for = "^(/zh)?/docs/(v3\\.3|v3\\.4|v4\\.1)(/.*)?$" + [headers.values] + Cache-Control = "no-store, max-age=0" + X-Robots-Tag = "noindex, nofollow" + +