1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-10 02:51:02 +01:00

nix-manual: Split out redirects.json

This commit is contained in:
Robert Hensing 2025-12-05 01:35:56 +01:00
parent 92d4fafd53
commit 3632abb7a5
5 changed files with 501 additions and 460 deletions

View file

@ -0,0 +1,15 @@
#!/usr/bin/env python3
"""Generate redirects.js from template and JSON data."""
import sys
template_path, json_path, output_path = sys.argv[1:]
with open(json_path) as f:
json_content = f.read().rstrip()
with open(template_path) as f:
template = f.read()
with open(output_path, 'w') as f:
f.write(template.replace('@REDIRECTS_JSON@', json_content))