Skip to content

Commit c9d3f06

Browse files
Merge pull request #3281 from fuchunlan/remove-doc-1
fix: Disable doc url
2 parents d573a4f + 6bd8571 commit c9d3f06

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

layouts/docs/single.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
{{ $disabled := or (hasPrefix .RelPermalink "/zh/docs/v3.3")
2+
(hasPrefix .RelPermalink "/zh/docs/v3.4")
3+
(hasPrefix .RelPermalink "/zh/docs/v4.1")
4+
(hasPrefix .RelPermalink "/docs/v3.3")
5+
(hasPrefix .RelPermalink "/docs/v3.4")
6+
(hasPrefix .RelPermalink "/docs/v4.1") }}
7+
8+
{{ if $disabled }}
9+
<!DOCTYPE html>
10+
<html>
11+
<head>
12+
<meta http-equiv="refresh" content="0; url=/404.html">
13+
<script>window.location = '/404.html';</script>
14+
<meta name="robots" content="noindex,nofollow">
15+
<meta http-equiv="Cache-Control" content="no-store">
16+
</head>
17+
<body></body>
18+
</html>
19+
{{ return }}
20+
{{ end }}
21+
122
<!DOCTYPE html>
223
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
324

netlify.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,17 @@
2828
status = 301
2929
force = true
3030

31+
[[redirects]]
32+
from = "^/(zh/)?docs/(v3\\.3|v3\\.4|v4\\.1)(/.*)?$"
33+
to = "/404.html"
34+
status = 404
35+
force = true
36+
conditions = { Role = "all" }
37+
38+
[[headers]]
39+
for = "^(/zh)?/docs/(v3\\.3|v3\\.4|v4\\.1)(/.*)?$"
40+
[headers.values]
41+
Cache-Control = "no-store, max-age=0"
42+
X-Robots-Tag = "noindex, nofollow"
43+
44+

0 commit comments

Comments
 (0)