-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6804db9
commit c860ece
Showing
2 changed files
with
20 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import json | ||
|
||
# Load the JSON file | ||
with open('../..mint.json', 'r') as file: | ||
data = json.load(file) | ||
|
||
# Open the output text file in write mode | ||
with open('config_internal_links_replacements.txt', 'w') as output_file: | ||
# Iterate through each redirect in the array | ||
for redirect in data.get('redirects', []): | ||
source = redirect.get('source', '') | ||
destination = redirect.get('destination', '') | ||
|
||
# Modify the source as specified | ||
modified_source = source.replace('/', '(', 1).replace('/', ':') + ' ' | ||
|
||
# Write to the output file | ||
output_file.write(f"{modified_source}\t{destination}\n") | ||
|
||
print("Redirects have been processed and written to redirects_output.txt") |
220 changes: 0 additions & 220 deletions
220
assets/scripts/api_files/internal_links_replacements.txt
This file was deleted.
Oops, something went wrong.