Skip to content

Commit c83cbdb

Browse files
committed
bin/generate_nginx_redirects: Prepend redirect_to path with DOCS_BASE_URL
1 parent 45c3971 commit c83cbdb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hypernode/redirect/generate_nginx_redirects.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os.path
2+
import re
23
from pathlib import Path
34
from typing import List
45

@@ -21,6 +22,8 @@ def get_path_for_doc(doc: Path) -> str:
2122
)
2223
path = path.replace("/./", "/")
2324
path = path.replace("/index.html", "/")
25+
base_url = os.getenv("DOCS_BASE_URL", "/")
26+
path = re.sub(r"^/", base_url, path)
2427
return path
2528

2629

0 commit comments

Comments
 (0)