Simplify www setup: symlink instead of two copies

/home/claude/www is now a symlink to the repo's www/ directory.
update-costs.sh writes to a single path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
claude 2026-03-16 15:43:30 +00:00
parent 728f7784d1
commit 1c35751095

View file

@ -23,7 +23,7 @@ python3 << 'PYEOF'
import json, re, sys
IMPACT_LOG = "/home/claude/claude-dir/.claude/impact/impact-log.jsonl"
PAGES = ["/home/claude/www/index.html", "/home/claude/claude-dir/www/index.html"]
LANDING_PAGE = "/home/claude/claude-dir/www/index.html"
# Read all entries, keep latest per session
sessions = {}
@ -73,17 +73,15 @@ new_para = (
f" </div>"
)
# Read and replace in all landing page copies
pattern = r"How this was made:</strong>.*?</div>"
for page in PAGES:
try:
with open(page) as f:
# Read and replace
with open(LANDING_PAGE) as f:
html = f.read()
new_html = re.sub(pattern, new_para, html, flags=re.DOTALL)
with open(page, "w") as f:
pattern = r"How this was made:</strong>.*?</div>"
new_html = re.sub(pattern, new_para, html, flags=re.DOTALL)
with open(LANDING_PAGE, "w") as f:
f.write(new_html)
except FileNotFoundError:
pass
print(f"Updated: {n} {session_word}, {total_energy} Wh, {total_co2}g CO2, {cost_display}")
PYEOF