39014-vm/update_header.py
Flatlogic Bot 184c212d8a version 15
2026-03-18 18:10:50 +00:00

21 lines
632 B
Python

import re
with open('tmp_header.html', 'r') as f:
content = f.read()
new_header = '''<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}}} -->
<div class="wp-block-group">
<!-- wp:site-title {"level":1,"style":{"typography":{"fontSize":"54px","lineHeight":"1.05","fontStyle":"normal","fontWeight":"700"},"color":{"text":"#316263"}}} /-->
</div>
<!-- /wp:group -->'''
content = re.sub(
r'<!-- wp:group \{"style":\{"spacing":\{"blockGap":"0px"\}\}\}.*?<!-- /wp:group -->',
new_header,
content,
count=1,
flags=re.IGNORECASE | re.DOTALL
)
with open('tmp_header_updated.html', 'w') as f:
f.write(content)