From 53f1df5e869df46d1ba44a0111a787df77a0a268 Mon Sep 17 00:00:00 2001 From: Zaine Arch Date: Tue, 30 Dec 2025 23:17:10 +0000 Subject: [PATCH] adding a json object for URLs --- search-index-json.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/search-index-json.py b/search-index-json.py index 1b63b50..84c5276 100644 --- a/search-index-json.py +++ b/search-index-json.py @@ -27,17 +27,19 @@ def create_folder_structure_json(path): return result for entry in os.listdir(path): + entry_path = os.path.join(path, entry) - + base_url = entry_path[6:] if os.path.isdir(entry_path): result['children'].append( create_folder_structure_json(entry_path) ) - + elif entry.lower().endswith('.html'): file_entry = { 'name': entry, 'type': 'file', + 'url': base_url, 'content': None }