105 lines
2.7 KiB
Python
105 lines
2.7 KiB
Python
import re
|
|
|
|
with open("tmp_pricing.html", "r") as f:
|
|
text = f.read()
|
|
|
|
# Insert the CSS
|
|
css_to_insert = """
|
|
/* Custom Header */
|
|
body.page-id-50 .wp-site-blocks > header.wp-block-template-part { display: none !important; }
|
|
|
|
.kmc-new-header-wrap {
|
|
position: sticky;
|
|
top: var(--wp-admin--admin-bar--height, 0px);
|
|
z-index: 9999;
|
|
background-color: #1C3434;
|
|
border-bottom: 1px solid rgba(144, 241, 174, 0.45);
|
|
}
|
|
.kmc-new-header-inner {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 18px 0;
|
|
width: min(1440px, calc(100% - 72px));
|
|
margin: 0 auto;
|
|
}
|
|
.kmc-new-logo {
|
|
color: #FFFFFF;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: clamp(16px, 1.8vw, 20px);
|
|
font-weight: 700;
|
|
text-decoration: none;
|
|
line-height: 1.08;
|
|
letter-spacing: -0.01em;
|
|
}
|
|
.kmc-new-nav-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: clamp(16px, 2.2vw, 36px);
|
|
}
|
|
.kmc-new-nav-links {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: clamp(16px, 2vw, 30px);
|
|
}
|
|
.kmc-new-nav-links a {
|
|
color: rgba(255,255,255,0.95);
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 18px;
|
|
font-weight: 600;
|
|
text-decoration: none;
|
|
line-height: 1.2;
|
|
}
|
|
.kmc-new-header-cta {
|
|
background-color: #FFFFFF;
|
|
color: #1C3434;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 16px;
|
|
font-weight: 700;
|
|
padding: 12px 24px;
|
|
border-radius: 999px;
|
|
text-decoration: none;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
line-height: 1;
|
|
}
|
|
|
|
@media (max-width: 980px) {
|
|
.kmc-new-header-inner { width: calc(100% - 48px); }
|
|
.kmc-new-header-inner { flex-wrap: wrap; padding: 18px 0; }
|
|
.kmc-new-nav-right { width: 100%; justify-content: space-between; margin-top: 16px; }
|
|
}
|
|
@media (max-width: 680px) {
|
|
.kmc-new-header-inner { width: calc(100% - 28px); }
|
|
.kmc-new-logo { font-size: 18px; }
|
|
.kmc-new-nav-right { flex-direction: column; align-items: flex-start; gap: 14px; }
|
|
.kmc-new-nav-links a { font-size: 16px; }
|
|
.kmc-new-header-cta { font-size: 14px; }
|
|
}
|
|
"""
|
|
|
|
html_to_insert = """
|
|
<div class="kmc-new-header-wrap">
|
|
<div class="kmc-new-header-inner">
|
|
<a href="/" class="kmc-new-logo">Founder Coaching</a>
|
|
<div class="kmc-new-nav-right">
|
|
<nav class="kmc-new-nav-links" aria-label="Primary">
|
|
<a href="/pricing/">Pricing</a>
|
|
<a href="/about/">About</a>
|
|
</nav>
|
|
<a href="https://calendly.com/ktmckeand/coaching-assessment" class="kmc-new-header-cta">Schedule an assessment</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
"""
|
|
|
|
# Find the end of the second <style> block where we can append the CSS
|
|
if "</style>" in text:
|
|
parts = text.rsplit("</style>", 1)
|
|
text = parts[0] + css_to_insert + "\n</style>\n" + html_to_insert + parts[1]
|
|
|
|
with open("tmp_pricing.html", "w") as f:
|
|
f.write(text)
|
|
|
|
print("SUCCESS")
|