070526 file refractor

This commit is contained in:
Kishore Kumar C
2026-05-07 18:31:19 +05:30
parent b9d99d98dd
commit 687d0547a0
88 changed files with 4033 additions and 296 deletions

31
scratch/fix_css_paths.py Normal file
View File

@@ -0,0 +1,31 @@
import os
dirs = [r'assets/css/vendor', r'assets/css/sections', r'assets/css/widgets']
replacements = [
('../fonts/', '../../fonts/'),
('assets/images/', '../../images/'),
('assets/fonts/', '../../fonts/')
]
for d in dirs:
if not os.path.exists(d):
print(f"Directory {d} does not exist")
continue
for root, _, files in os.walk(d):
for f in files:
if f.endswith('.css'):
path = os.path.join(root, f)
try:
with open(path, 'r', encoding='utf-8', errors='ignore') as file:
content = file.read()
new_content = content
for old, new in replacements:
new_content = new_content.replace(old, new)
if new_content != content:
with open(path, 'w', encoding='utf-8') as file:
file.write(new_content)
print(f"Updated {path}")
except Exception as e:
print(f"Error processing {path}: {e}")