video_ids.append("NNm-92NMenU")
# Buat ulang isi halaman khusus video dengan 3 video
video_gallery_html = '''
<b:includable id='static_page_video'>
<h2>Video Inspiratif</h2>
<div class="video-gallery" style="display:flex; flex-wrap:wrap; gap:20px;">
'''
for vid in video_ids:
video_gallery_html += f'''
<iframe width="300" height="170" src="https://www.youtube.com/embed/{vid}"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
'''
video_gallery_html += '''
</div>
</b:includable>
'''
# Sisipkan ulang ke template
template_base = base_template_path.read_text(encoding="utf-8")
# Sidebar tetap pakai video pertama
modified_template = template_base.replace(
"<!-- Iklan Sidebar -->",
video_embed_code_sidebar + "\n\n<!-- Iklan Sidebar -->"
)
# Tambahkan halaman video yang sudah diperbarui
modified_template = modified_template.replace(
"</b:template>",
video_gallery_html + "\n</b:template>"
)
# Simpan file baru
final_template_path = Path("/mnt/data/template-inspirasitimur-with-3videos.xml")
final_template_path.write_text(modified_template, encoding="utf-8")
final_template_path.name