39292-vm/fix_block6_final.py
2026-03-26 19:21:35 +00:00

41 lines
2.3 KiB
Python

import re
with open('home_content.html', 'r', encoding='utf-8') as f:
content = f.read()
# 1. Update background color of section to #FFFFFF
content = re.sub(
r'(\.kmc-sixth-section\s*\{\s*background:\s*)#F8F7F3(;)',
r'\1#FFFFFF\2',
content
)
# 2. Update the paragraph text
old_text = r"As your coach and transformation partner, our results are driven by who you're being, not the tactics your doing\. Success demands total commitment to achieving the impossible\."
new_text = r"Coaching is a partnership designed for growth — outcomes depend on commitment and context."
content = re.sub(old_text, new_text, content)
# 3. Update icons
icon1 = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect><path d="M9 14l2 2 4-4"></path></svg>'
icon2 = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>'
icon3 = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="7"></circle><polyline points="8.21 13.89 7 23 12 20 17 23 15.79 13.88"></polyline></svg>'
# Find the three articles and replace their svgs
articles = re.findall(r'(<article class="kmc-sixth-card".*?</article>)', content, flags=re.DOTALL)
if len(articles) == 3:
# Card 1
new_art1 = re.sub(r'<svg.*?</svg>', icon1, articles[0], count=1, flags=re.DOTALL)
content = content.replace(articles[0], new_art1)
# Card 2
new_art2 = re.sub(r'<svg.*?</svg>', icon2, articles[1], count=1, flags=re.DOTALL)
content = content.replace(articles[1], new_art2)
# Card 3
new_art3 = re.sub(r'<svg.*?</svg>', icon3, articles[2], count=1, flags=re.DOTALL)
content = content.replace(articles[2], new_art3)
else:
print(f"Error: Found {len(articles)} articles instead of 3!")
with open('home_content.html', 'w', encoding='utf-8') as f:
f.write(content)
print("Updated home_content.html")