aboutsummaryrefslogtreecommitdiff
path: root/build.py
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-03-23 10:48:47 -0500
committerChristian Cleberg <[email protected]>2026-03-23 10:48:47 -0500
commitc5ddea05b5421a0abd549406f300dc5e3968e3c5 (patch)
tree40177672ec2fd37fba7a5a001a7cb6444156d581 /build.py
parentafc13ea6b9b3281d156c93da33e4ea76be9ba60c (diff)
downloadcleberg.net-c5ddea05b5421a0abd549406f300dc5e3968e3c5.tar.gz
cleberg.net-c5ddea05b5421a0abd549406f300dc5e3968e3c5.tar.bz2
cleberg.net-c5ddea05b5421a0abd549406f300dc5e3968e3c5.zip
publish Domain Dig link
Diffstat (limited to 'build.py')
-rw-r--r--build.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/build.py b/build.py
index b3e04a4..f109ce3 100644
--- a/build.py
+++ b/build.py
@@ -34,6 +34,16 @@ from datetime import datetime
from pathlib import Path
+def run_ruff():
+ print("Running ruff...")
+ for cmd in [["ruff", "check", "--fix"], ["ruff", "format"]]:
+ result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
+ if result.returncode != 0:
+ print(f"ruff error ({' '.join(cmd)}):")
+ print(result.stderr, file=sys.stderr)
+ sys.exit(1)
+
+
def update_index_html(html_snippet, template_path="./.build/index.html"):
"""
Read the index.html file at `template_path`, replace everything between
@@ -558,6 +568,7 @@ def start_dev_server(build_dir):
def main():
+ run_ruff()
html_snippet = get_recent_posts_html("./content/blog", num_posts=3)
build_dir = Path(".build")