Compare commits
1 Commits
main
...
claude/iss
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
852a38e686 |
10
api/health/index.json
Normal file
10
api/health/index.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"status": "ok",
|
||||||
|
"services": {
|
||||||
|
"api": true,
|
||||||
|
"agent_loop": false,
|
||||||
|
"websocket": false
|
||||||
|
},
|
||||||
|
"uptime": null,
|
||||||
|
"version": "20260322.230710"
|
||||||
|
}
|
||||||
@@ -17,14 +17,17 @@ Generates:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import html
|
import html
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
SITE_URL = "https://alexanderwhitestone.com"
|
SITE_URL = "https://alexanderwhitestone.com"
|
||||||
BLOG_DIR = Path(__file__).parent.parent / "blog"
|
ROOT_DIR = Path(__file__).parent.parent
|
||||||
|
BLOG_DIR = ROOT_DIR / "blog"
|
||||||
POSTS_DIR = BLOG_DIR / "posts"
|
POSTS_DIR = BLOG_DIR / "posts"
|
||||||
|
HEALTH_DIR = ROOT_DIR / "api" / "health"
|
||||||
|
|
||||||
PAGE_STYLE = """\
|
PAGE_STYLE = """\
|
||||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||||
@@ -291,6 +294,23 @@ def generate_feed(posts):
|
|||||||
print(f" Generated feed with {len(entries)} entry/entries.")
|
print(f" Generated feed with {len(entries)} entry/entries.")
|
||||||
|
|
||||||
|
|
||||||
|
def generate_health():
|
||||||
|
"""Generate api/health/index.json with build-time metadata."""
|
||||||
|
HEALTH_DIR.mkdir(parents=True, exist_ok=True)
|
||||||
|
health = {
|
||||||
|
"status": "ok",
|
||||||
|
"services": {
|
||||||
|
"api": True,
|
||||||
|
"agent_loop": False,
|
||||||
|
"websocket": False,
|
||||||
|
},
|
||||||
|
"uptime": None,
|
||||||
|
"version": datetime.now(timezone.utc).strftime("%Y%m%d.%H%M%S"),
|
||||||
|
}
|
||||||
|
(HEALTH_DIR / "index.json").write_text(json.dumps(health, indent=2) + "\n")
|
||||||
|
print(" Generated api/health endpoint.")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("Building The Scrolls...")
|
print("Building The Scrolls...")
|
||||||
posts = load_posts()
|
posts = load_posts()
|
||||||
@@ -299,6 +319,7 @@ def main():
|
|||||||
print(f" Built: {out.relative_to(BLOG_DIR.parent)}")
|
print(f" Built: {out.relative_to(BLOG_DIR.parent)}")
|
||||||
generate_index(posts)
|
generate_index(posts)
|
||||||
generate_feed(posts)
|
generate_feed(posts)
|
||||||
|
generate_health()
|
||||||
print("Build complete.")
|
print("Build complete.")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user