6989a98d75
- Arkitektur: docs/auth/passwordless-architecture.md - Backend: iom/quixzoom-auth-service/ (FastAPI + Redis) - Webb: quixzoom-market-pages/se/login/ (QR-kod + polling) - App: iom/quixzoom-app/src/features/auth/ (push + deep links) Flöde: QR-kod → app-godkännande → webb-inloggad
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Remove hreflang tags that point to dead domains.
|
|
"""
|
|
|
|
import os
|
|
import re
|
|
|
|
def remove_hreflang(filepath):
|
|
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
|
|
content = f.read()
|
|
|
|
original = content
|
|
# Remove hreflang link tags
|
|
content = re.sub(r'\s*<link rel="alternate" hreflang="[^"]+" href="https://landvex\.(se|de|fr|co\.uk)/">\n?', '', content)
|
|
|
|
if content != original:
|
|
with open(filepath, 'w', encoding='utf-8') as f:
|
|
f.write(content)
|
|
return True
|
|
return False
|
|
|
|
def main():
|
|
base_dir = "/home/bernt/.openclaw/workspace/landvex-all"
|
|
count = 0
|
|
|
|
for root, dirs, files in os.walk(base_dir):
|
|
for file in files:
|
|
if file.endswith('.html'):
|
|
filepath = os.path.join(root, file)
|
|
if remove_hreflang(filepath):
|
|
count += 1
|
|
rel_path = os.path.relpath(filepath, base_dir)
|
|
print(f"Removed hreflang: {rel_path}")
|
|
|
|
print(f"\nDone: Removed hreflang from {count} files")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|