aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cleberg <hello@cleberg.net>2025-06-03 20:15:14 -0500
committerChristian Cleberg <hello@cleberg.net>2025-06-03 20:15:14 -0500
commit3b0f036adc418cd5c587d7db6a11a20e8bdd5682 (patch)
tree1c82b5f5652bd8df099a77d0122db5bb525b6b74
parentc9dc6b406189b97cbed02e8ad00a30e13eb8b3ac (diff)
downloadcleberg.net-3b0f036adc418cd5c587d7db6a11a20e8bdd5682.tar.gz
cleberg.net-3b0f036adc418cd5c587d7db6a11a20e8bdd5682.tar.bz2
cleberg.net-3b0f036adc418cd5c587d7db6a11a20e8bdd5682.zip
fix: move dynamic updates to .build dir
-rw-r--r--build.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/build.py b/build.py
index e620202..60b9d27 100644
--- a/build.py
+++ b/build.py
@@ -8,7 +8,7 @@ from pathlib import Path
from datetime import datetime
-def update_index_html(html_snippet, template_path="./theme/templates/index.html"):
+def update_index_html(html_snippet, template_path="./.build/index.html"):
"""
Read the index.html file at `template_path`, replace everything between
<!-- BEGIN_POSTS --> and <!-- END_POSTS --> with the provided html_snippet,
@@ -255,7 +255,6 @@ def start_dev_server(build_dir):
def main():
html_snippet = get_recent_posts_html("./content/blog", num_posts=3)
- update_index_html(html_snippet)
build_dir = Path(".build")
theme_dir = Path("theme/static")
@@ -283,6 +282,9 @@ def main():
# Run publishing script (silenced output)
run_emacs_publish(dev_mode=False)
+ # Update index page with latest posts
+ update_index_html(html_snippet)
+
# Deploy changes
deploy_to_server(build_dir, homelab_server)
@@ -298,6 +300,9 @@ def main():
# Run publishing script (with console output)
run_emacs_publish(dev_mode=True)
+ # Update index page with latest posts
+ update_index_html(html_snippet)
+
# Launch development web server
start_dev_server(build_dir)