39292-vm/update_home_titles.py
2026-03-12 15:10:14 +00:00

50 lines
3.0 KiB
Python

import re
with open('home_content.html', 'r') as f:
content = f.read()
# 1. Update H1
content = content.replace(
'<!-- wp:heading {"level":1,"style":{"typography":{"fontSize":"54px","lineHeight":"1.05"}}} -->\n<h1 style="font-size:54px;line-height:1.05">Executive and Life Coaching to Achieve your Potential</h1>',
'<!-- wp:heading {"level":1,"style":{"typography":{"fontSize":"54px","lineHeight":"1.05"},"color":{"text":"#ffffff"}},"textColor":"white"} -->\n<h1 class="has-white-color has-text-color" style="font-size:54px;line-height:1.05;color:#ffffff">Executive and Life Coaching to Achieve your Potential</h1>'
)
# 2. Update H2 "Sample outcomes clients seek"
content = content.replace(
'<!-- wp:heading {"level":2} -->\n<h2>Sample outcomes clients seek</h2>',
'<!-- wp:heading {"level":2,"style":{"color":{"text":"#ffffff"}},"textColor":"white"} -->\n<h2 class="has-white-color has-text-color" style="color:#ffffff">Sample outcomes clients seek</h2>'
)
# 3. Move "Includes 4 hours of coaching"
old_pricing_block = """<!-- wp:paragraph -->
<p>Includes 4 hours of coaching</p>
<!-- /wp:paragraph -->
<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button {"style":{"border":{"radius":"999px"},"spacing":{"padding":{"top":"10px","bottom":"10px","left":"18px","right":"18px"}},"color":{"background":"#0f172a","text":"#ffffff"}},"width":100} -->
<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link has-text-color has-background" href="/pay/" style="border-radius:999px;background-color:#0f172a;color:#ffffff;padding-top:10px;padding-right:18px;padding-bottom:10px;padding-left:18px;text-align:center">Book Now</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->"""
new_pricing_block = """<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button {"style":{"border":{"radius":"999px"},"spacing":{"padding":{"top":"10px","bottom":"10px","left":"18px","right":"18px"}},"color":{"background":"#0f172a","text":"#ffffff"}},"width":100} -->
<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link has-text-color has-background" href="/pay/" style="border-radius:999px;background-color:#0f172a;color:#ffffff;padding-top:10px;padding-right:18px;padding-bottom:10px;padding-left:18px;text-align:center">Book Now</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->
<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">Includes 4 hours of coaching</p>
<!-- /wp:paragraph -->"""
content = content.replace(old_pricing_block, new_pricing_block)
# Also check Credentials title text, make it white
content = content.replace(
'<!-- wp:paragraph {"style":{"typography":{"fontSize":"16px"}}} -->\n<p style="font-size:16px"><strong>Credentials</strong></p>',
'<!-- wp:paragraph {"style":{"typography":{"fontSize":"16px"},"color":{"text":"#ffffff"}},"textColor":"white"} -->\n<p class="has-white-color has-text-color" style="font-size:16px;color:#ffffff"><strong>Credentials</strong></p>'
)
with open('home_content.html', 'w') as f:
f.write(content)