Commit 37ae034013

37ae0340134d692c02621a365768dc8a7cbae109

parent: 8c8c09b13e

Unsigned

cmc <hello@cleberg.net> · 2025-06-04 01:15 UTC

fix: move dynamic updates to .build dir

Layout: unified · split

build.py +7 −2
@@ -8,7 +8,7 @@ from pathlib import Path
88from datetime import datetime
99
1010
11def update_index_html(html_snippet, template_path="./theme/templates/index.html"):
11def update_index_html(html_snippet, template_path="./.build/index.html"):
1212 """
1313 Read the index.html file at `template_path`, replace everything between
1414 <!-- BEGIN_POSTS --> and <!-- END_POSTS --> with the provided html_snippet,
@@ -255,7 +255,6 @@ def start_dev_server(build_dir):
255255
256256def main():
257257 html_snippet = get_recent_posts_html("./content/blog", num_posts=3)
258 update_index_html(html_snippet)
259258
260259 build_dir = Path(".build")
261260 theme_dir = Path("theme/static")
@@ -283,6 +282,9 @@ def main():
283282 # Run publishing script (silenced output)
284283 run_emacs_publish(dev_mode=False)
285284
285 # Update index page with latest posts
286 update_index_html(html_snippet)
287
286288 # Deploy changes
287289 deploy_to_server(build_dir, homelab_server)
288290
@@ -298,6 +300,9 @@ def main():
298300 # Run publishing script (with console output)
299301 run_emacs_publish(dev_mode=True)
300302
303 # Update index page with latest posts
304 update_index_html(html_snippet)
305
301306 # Launch development web server
302307 start_dev_server(build_dir)
303308