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:
parent
92d4fafd53
commit
3632abb7a5
5 changed files with 501 additions and 460 deletions
15
doc/manual/generate-redirects.py
Normal file
15
doc/manual/generate-redirects.py
Normal 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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue