Skip to content

Commit ddcd0e5

Browse files
authored
Add redirects for new translations (#598)
1 parent 4775b7f commit ddcd0e5

File tree

4 files changed

+198
-3
lines changed

4 files changed

+198
-3
lines changed

salt/docs/config/nginx.docs-redirects.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ location = / {
77
return 302 $scheme://$host/3/;
88
}
99

10-
# Python 3 docs are the default at the root of each translations.
11-
location ~ ^/(es|fr|id|it|ja|ko|pl|pt-br|tr|uk|zh-cn|zh-tw)/$ {
10+
# Python 3 docs are the default at the root of each translation.
11+
location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|tr|uk|zh-cn|zh-tw)/$ {
1212
return 302 $scheme://$host/$1/3/;
1313
}
1414

@@ -190,7 +190,7 @@ location ~ ^/((2|3)(\.[0-9]+)?|dev)/\w+/[\d\w\.]+(?!\.html)$ {
190190
location ~ ^/((2|3)(\.[0-9]+)?|dev)/ {
191191
add_header Surrogate-Key en/$1 always;
192192
}
193-
location ~ ^/(es|fr|id|it|ja|ko|pl|pt-br|tr|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ {
193+
location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|tr|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ {
194194
add_header Surrogate-Key $1/$2 always;
195195
}
196196

tests/docs-redirects/specs/PEP-594.hurl

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,36 @@ HTTP 301
1818
[Asserts]
1919
header "Location" == "https://localhost/3.14/"
2020

21+
GET {{host}}/bn-in/3/library/2to3.html
22+
HTTP 301
23+
[Asserts]
24+
header "Location" == "https://localhost/bn-in/3/"
25+
26+
GET {{host}}/bn-in/3.13/library/2to3.html
27+
HTTP 301
28+
[Asserts]
29+
header "Location" == "https://localhost/bn-in/3.13/"
30+
31+
GET {{host}}/bn-in/3.14/library/2to3.html
32+
HTTP 301
33+
[Asserts]
34+
header "Location" == "https://localhost/bn-in/3.14/"
35+
36+
GET {{host}}/el/3/library/2to3.html
37+
HTTP 301
38+
[Asserts]
39+
header "Location" == "https://localhost/el/3/"
40+
41+
GET {{host}}/el/3.13/library/2to3.html
42+
HTTP 301
43+
[Asserts]
44+
header "Location" == "https://localhost/el/3.13/"
45+
46+
GET {{host}}/el/3.14/library/2to3.html
47+
HTTP 301
48+
[Asserts]
49+
header "Location" == "https://localhost/el/3.14/"
50+
2151
GET {{host}}/es/3/library/2to3.html
2252
HTTP 301
2353
[Asserts]
@@ -138,6 +168,21 @@ HTTP 301
138168
[Asserts]
139169
header "Location" == "https://localhost/pt-br/3.14/"
140170

171+
GET {{host}}/ro/3/library/2to3.html
172+
HTTP 301
173+
[Asserts]
174+
header "Location" == "https://localhost/ro/3/"
175+
176+
GET {{host}}/ro/3.13/library/2to3.html
177+
HTTP 301
178+
[Asserts]
179+
header "Location" == "https://localhost/ro/3.13/"
180+
181+
GET {{host}}/ro/3.14/library/2to3.html
182+
HTTP 301
183+
[Asserts]
184+
header "Location" == "https://localhost/ro/3.14/"
185+
141186
GET {{host}}/tr/3/library/2to3.html
142187
HTTP 301
143188
[Asserts]
@@ -215,6 +260,36 @@ HTTP 301
215260
[Asserts]
216261
header "Location" == "https://localhost/3.14/"
217262

263+
GET {{host}}/bn-in/3/library/tkinter.tix.html
264+
HTTP 301
265+
[Asserts]
266+
header "Location" == "https://localhost/bn-in/3/"
267+
268+
GET {{host}}/bn-in/3.13/library/tkinter.tix.html
269+
HTTP 301
270+
[Asserts]
271+
header "Location" == "https://localhost/bn-in/3.13/"
272+
273+
GET {{host}}/bn-in/3.14/library/tkinter.tix.html
274+
HTTP 301
275+
[Asserts]
276+
header "Location" == "https://localhost/bn-in/3.14/"
277+
278+
GET {{host}}/el/3/library/tkinter.tix.html
279+
HTTP 301
280+
[Asserts]
281+
header "Location" == "https://localhost/el/3/"
282+
283+
GET {{host}}/el/3.13/library/tkinter.tix.html
284+
HTTP 301
285+
[Asserts]
286+
header "Location" == "https://localhost/el/3.13/"
287+
288+
GET {{host}}/el/3.14/library/tkinter.tix.html
289+
HTTP 301
290+
[Asserts]
291+
header "Location" == "https://localhost/el/3.14/"
292+
218293
GET {{host}}/es/3/library/tkinter.tix.html
219294
HTTP 301
220295
[Asserts]
@@ -335,6 +410,21 @@ HTTP 301
335410
[Asserts]
336411
header "Location" == "https://localhost/pt-br/3.14/"
337412

413+
GET {{host}}/ro/3/library/tkinter.tix.html
414+
HTTP 301
415+
[Asserts]
416+
header "Location" == "https://localhost/ro/3/"
417+
418+
GET {{host}}/ro/3.13/library/tkinter.tix.html
419+
HTTP 301
420+
[Asserts]
421+
header "Location" == "https://localhost/ro/3.13/"
422+
423+
GET {{host}}/ro/3.14/library/tkinter.tix.html
424+
HTTP 301
425+
[Asserts]
426+
header "Location" == "https://localhost/ro/3.14/"
427+
338428
GET {{host}}/tr/3/library/tkinter.tix.html
339429
HTTP 301
340430
[Asserts]

tests/docs-redirects/specs/default-root.hurl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ header "Location" == "http://localhost/3/"
88

99
# Assert that Python 3 is the default at the root of each translation.
1010

11+
GET {{host}}/bn-in/
12+
HTTP 302
13+
[Asserts]
14+
header "Location" == "http://localhost/bn-in/3/"
15+
16+
GET {{host}}/el/
17+
HTTP 302
18+
[Asserts]
19+
header "Location" == "http://localhost/el/3/"
20+
1121
GET {{host}}/es/
1222
HTTP 302
1323
[Asserts]
@@ -48,6 +58,11 @@ HTTP 302
4858
[Asserts]
4959
header "Location" == "http://localhost/pt-br/3/"
5060

61+
GET {{host}}/ro/
62+
HTTP 302
63+
[Asserts]
64+
header "Location" == "http://localhost/ro/3/"
65+
5166
GET {{host}}/tr/
5267
HTTP 302
5368
[Asserts]

tests/docs-redirects/specs/surrogate-key.hurl

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,66 @@ header "Surrogate-Key" == "en/3.14"
295295

296296
## Languages
297297

298+
GET {{host}}/bn-in/3/
299+
HTTP 404
300+
[Asserts]
301+
header "Surrogate-Key" == "bn-in/3"
302+
303+
GET {{host}}/bn-in/3/about.html
304+
HTTP 404
305+
[Asserts]
306+
header "Surrogate-Key" == "bn-in/3"
307+
308+
GET {{host}}/bn-in/3.14/
309+
HTTP 404
310+
[Asserts]
311+
header "Surrogate-Key" == "bn-in/3.14"
312+
313+
GET {{host}}/bn-in/3.14/about.html
314+
HTTP 404
315+
[Asserts]
316+
header "Surrogate-Key" == "bn-in/3.14"
317+
318+
GET {{host}}/bn-in/dev/
319+
HTTP 404
320+
[Asserts]
321+
header "Surrogate-Key" == "bn-in/dev"
322+
323+
GET {{host}}/bn-in/dev/about.html
324+
HTTP 404
325+
[Asserts]
326+
header "Surrogate-Key" == "bn-in/dev"
327+
328+
GET {{host}}/el/3/
329+
HTTP 404
330+
[Asserts]
331+
header "Surrogate-Key" == "el/3"
332+
333+
GET {{host}}/el/3/about.html
334+
HTTP 404
335+
[Asserts]
336+
header "Surrogate-Key" == "el/3"
337+
338+
GET {{host}}/el/3.14/
339+
HTTP 404
340+
[Asserts]
341+
header "Surrogate-Key" == "el/3.14"
342+
343+
GET {{host}}/el/3.14/about.html
344+
HTTP 404
345+
[Asserts]
346+
header "Surrogate-Key" == "el/3.14"
347+
348+
GET {{host}}/el/dev/
349+
HTTP 404
350+
[Asserts]
351+
header "Surrogate-Key" == "el/dev"
352+
353+
GET {{host}}/el/dev/about.html
354+
HTTP 404
355+
[Asserts]
356+
header "Surrogate-Key" == "el/dev"
357+
298358
GET {{host}}/es/3/
299359
HTTP 404
300360
[Asserts]
@@ -535,6 +595,36 @@ HTTP 404
535595
[Asserts]
536596
header "Surrogate-Key" == "pt-br/dev"
537597

598+
GET {{host}}/ro/3/
599+
HTTP 404
600+
[Asserts]
601+
header "Surrogate-Key" == "ro/3"
602+
603+
GET {{host}}/ro/3/about.html
604+
HTTP 404
605+
[Asserts]
606+
header "Surrogate-Key" == "ro/3"
607+
608+
GET {{host}}/ro/3.14/
609+
HTTP 404
610+
[Asserts]
611+
header "Surrogate-Key" == "ro/3.14"
612+
613+
GET {{host}}/ro/3.14/about.html
614+
HTTP 404
615+
[Asserts]
616+
header "Surrogate-Key" == "ro/3.14"
617+
618+
GET {{host}}/ro/dev/
619+
HTTP 404
620+
[Asserts]
621+
header "Surrogate-Key" == "ro/dev"
622+
623+
GET {{host}}/ro/dev/about.html
624+
HTTP 404
625+
[Asserts]
626+
header "Surrogate-Key" == "ro/dev"
627+
538628
GET {{host}}/tr/3/
539629
HTTP 404
540630
[Asserts]

0 commit comments

Comments
 (0)