From b2c2033c61f222138245536102c2058d9117889f Mon Sep 17 00:00:00 2001 From: Bhuvansh Kataria Date: Thu, 22 Oct 2026 11:55:09 +0000 Subject: [PATCH] Add redirects for the Punjabi (pa) translation --- salt/docs/config/nginx.docs-redirects.conf | 4 +-- tests/docs-redirects/specs/PEP-594.hurl | 30 +++++++++++++++++++ tests/docs-redirects/specs/default-root.hurl | 5 ++++ tests/docs-redirects/specs/surrogate-key.hurl | 30 +++++++++++++++++++ 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/salt/docs/config/nginx.docs-redirects.conf b/salt/docs/config/nginx.docs-redirects.conf index 43ae6dae..7ac8d77f 100644 --- a/salt/docs/config/nginx.docs-redirects.conf +++ b/salt/docs/config/nginx.docs-redirects.conf @@ -8,7 +8,7 @@ location = / { } # Python 3 docs are the default at the root of each translation. -location ~ ^/(bn-in|de|el|es|fa|fr|id|it|ja|ko|pl|pt-br|ro|ru|sv|tr|uk|zh-cn|zh-tw)/$ { +location ~ ^/(bn-in|de|el|es|fa|fr|id|it|ja|ko|pa|pl|pt-br|ro|ru|sv|tr|uk|zh-cn|zh-tw)/$ { return 302 $scheme://$host/$1/3/; } @@ -195,7 +195,7 @@ location ~ ^/((2|3)(\.[0-9]+)?|dev)/ { error_page 404 /$1/404.html; add_header Surrogate-Key en/$1 always; } -location ~ ^/(bn-in|de|el|es|fa|fr|id|it|ja|ko|pl|pt-br|ro|ru|tr|sv|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { +location ~ ^/(bn-in|de|el|es|fa|fr|id|it|ja|ko|pa|pl|pt-br|ro|ru|tr|sv|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { error_page 404 /$1/$2/404.html; add_header Surrogate-Key $1/$2 always; } diff --git a/tests/docs-redirects/specs/PEP-594.hurl b/tests/docs-redirects/specs/PEP-594.hurl index 3539d5bb..2bc12ca2 100644 --- a/tests/docs-redirects/specs/PEP-594.hurl +++ b/tests/docs-redirects/specs/PEP-594.hurl @@ -168,6 +168,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/ko/3.14/" +GET {{host}}/pa/3/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/pa/3/" + +GET {{host}}/pa/3.13/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/pa/3.13/" + +GET {{host}}/pa/3.14/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/pa/3.14/" + GET {{host}}/pl/3/library/2to3.html HTTP 301 [Asserts] @@ -470,6 +485,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/ko/3.14/" +GET {{host}}/pa/3/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/pa/3/" + +GET {{host}}/pa/3.13/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/pa/3.13/" + +GET {{host}}/pa/3.14/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/pa/3.14/" + GET {{host}}/pl/3/library/tkinter.tix.html HTTP 301 [Asserts] diff --git a/tests/docs-redirects/specs/default-root.hurl b/tests/docs-redirects/specs/default-root.hurl index efd32066..72cb98d6 100644 --- a/tests/docs-redirects/specs/default-root.hurl +++ b/tests/docs-redirects/specs/default-root.hurl @@ -58,6 +58,11 @@ HTTP 302 [Asserts] header "Location" == "http://localhost/ko/3/" +GET {{host}}/pa/ +HTTP 302 +[Asserts] +header "Location" == "http://localhost/pa/3/" + GET {{host}}/pl/ HTTP 302 [Asserts] diff --git a/tests/docs-redirects/specs/surrogate-key.hurl b/tests/docs-redirects/specs/surrogate-key.hurl index fb12f846..821e98cf 100644 --- a/tests/docs-redirects/specs/surrogate-key.hurl +++ b/tests/docs-redirects/specs/surrogate-key.hurl @@ -595,6 +595,36 @@ HTTP 404 [Asserts] header "Surrogate-Key" == "ko/dev" +GET {{host}}/pa/3/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "pa/3" + +GET {{host}}/pa/3/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "pa/3" + +GET {{host}}/pa/3.14/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "pa/3.14" + +GET {{host}}/pa/3.14/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "pa/3.14" + +GET {{host}}/pa/dev/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "pa/dev" + +GET {{host}}/pa/dev/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "pa/dev" + GET {{host}}/pl/3/ HTTP 200 [Asserts]