Skip to content

Commit 3d9e888

Browse files
authored
Merge branch 'master' into xls-draft-confidential-mpt
2 parents 45efbbd + 121f123 commit 3d9e888

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

scripts/build_site.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,15 @@ def build_site():
120120
)
121121

122122
# /xls/ alias: /xls/xls-<number>.html
123-
redirect_xls_path = site_dir / "xls" / f"xls-{doc.number}.html"
124-
with open(redirect_xls_path, "w", encoding="utf-8") as f:
125-
f.write(redirect_html)
123+
def add_redirect(redirect_url, target_url):
124+
redirect_xls_path = site_dir / "xls" / redirect_url
125+
with open(redirect_xls_path, "w", encoding="utf-8") as f:
126+
f.write(redirect_html)
126127

127-
print(f"Generated redirect: {redirect_xls_path} -> {target_url}")
128+
print(f"Generated redirect: {redirect_xls_path} -> {target_url}")
129+
130+
add_redirect(f"xls-{doc.number}.html", target_url)
131+
add_redirect(f"xls-{doc.raw_number}.html", target_url)
128132

129133
# Group documents by category for category pages and navigation
130134
categories = {}

scripts/xls_parser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class XLSDocument:
2929
"""Represents an XLS document with metadata."""
3030

3131
number: str
32+
raw_number: int
3233
title: str
3334
description: str
3435
authors: List[Tuple[str, str]] # Tuple of (author_name, author_link)
@@ -123,11 +124,14 @@ def format_author(author):
123124
xls_match = re.match(r"XLS-(\d+)([d]?)", folder_name)
124125
if xls_match:
125126
number = xls_match.group(1)
127+
raw_number = int(number)
126128
else:
127129
number = "000"
130+
raw_number = 0
128131

129132
return XLSDocument(
130133
number=number,
134+
raw_number=raw_number,
131135
title=metadata.get("title", "Unknown Title"),
132136
description=metadata.get("description", "No description available"),
133137
authors=metadata.get("authors", [("Unknown Author", "")]),

0 commit comments

Comments
 (0)