Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/693c70a4-9498-8011-87ee-efb5576cc53d
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assistant: You’re right — we already did this properly. === You’re right — we already did this properly. 😊 Let me line it up clearly so we don’t confuse build-meta vs build-info. ==== You already have the correct footer in: ==== <syntaxhighlight lang="bash">~/projects/wsi-website/src/index.html </syntaxhighlight> Content (what you pasted) is perfect: <syntaxhighlight lang="html"><!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>WhiteStone Intelligence (WSI)</title> <!-- Basic styling (remove if Tailwind is injected globally) --> <style> body { font-family: Arial, sans-serif; margin: 40px; line-height: 1.6; } footer { margin-top: 40px; font-size: 0.75rem; color: #666; text-align: center; } </style> </head> <body> <h1>WhiteStone Intelligence (WSI)</h1> <p>WSI Community Cloud website is running successfully.</p> <!-- Build Metadata Footer --> <footer id="build-meta"> Loading build metadata... </footer> <script> fetch('/build-meta.json') .then(res => res.json()) .then(meta => { document.getElementById('build-meta').textContent = <code>Build: ${meta.build_time} • Commit: ${meta.commit} • Source: ${meta.source}</code>; }) .catch(() => { document.getElementById('build-meta').textContent = "Build metadata unavailable."; }); </script> </body> </html> </syntaxhighlight> ✅ Footer is in the right place. ✅ It’s calling /build-meta.json (not /build-info.json) – that’s fine. My earlier message that used /build-info.json was inconsistent with what you already implemented. Your current version with /build-meta.json is perfectly OK — let’s lock in on that. ==== For the footer to actually show data (instead of “Loading…”), two things must be true in the final deployed site root (both Local site/ and VPS /usr/share/caddy): ==== # index.html (with that <footer id="build-meta">) # build-meta.json in the same directory as index.html So on Local, after build + copy, you want: <syntaxhighlight lang="bash">ls ~/projects/wsi-website/site === should show: === === assets/ en/ zh/ index.html build-meta.json === </syntaxhighlight> On VPS, inside the running container: <syntaxhighlight lang="bash">docker exec -it wsi-caddy sh -c "ls -l /usr/share/caddy" === should show: === === assets/ en/ zh/ index.html build-meta.json === </syntaxhighlight> ==== On Local (you already basically did this, but here is the “canonical” sequence using build-meta.json): ==== 1️⃣ Build Tailwind + metadata: <syntaxhighlight lang="bash">cd ~/projects/wsi-website npm run build </syntaxhighlight> Your build-meta.sh should be something like this (just to align with /build-meta.json): <syntaxhighlight lang="bash">#!/usr/bin/env bash set -e BUILD_TIME=$(date -u +"%Y-%m-%d %H:%M:%S UTC") COMMIT=$(git rev-parse --short HEAD || echo "N/A") SOURCE="LOCAL" cat > build-meta.json <<EOF { "build_time": "$BUILD_TIME", "commit": "$COMMIT", "source": "$SOURCE" } EOF echo "Build metadata generated:" cat build-meta.json </syntaxhighlight> 2️⃣ Copy built files into site/ including build-meta.json: <syntaxhighlight lang="bash">rm -rf site/* cp -r src/* site/ cp build-meta.json site/ </syntaxhighlight> 3️⃣ Commit and push: <syntaxhighlight lang="bash">git add -A git commit -m "Update build + metadata footer" git push </syntaxhighlight> ==== Your deployment is now: ==== * LOCAL: ~/projects/wsi-website → npm run build → site/ + build-meta.json → git push * GitHub Actions: (if/when we update it for this project) → checkout repo → either use site/ directly or rebuild → scp to VPS /home/cesadmin/projects/wsi-website-prod/site/ * VPS (wsi-website-prod project): - Caddy volume points /usr/share/caddy → /home/cesadmin/projects/wsi-website-prod/site - Browser requests https://whitestoneintel.com/ - index.html loads - JS calls GET /build-meta.json - Footer displays: Build: 2025-12-12 00:47:41 UTC • Commit: e2d3d98 • Source: LOCAL ===== On VPS (host): ===== <syntaxhighlight lang="bash">cd ~/projects/wsi-website-prod ls site === expect: assets/ en/ zh/ index.html build-meta.json === </syntaxhighlight> Then inside container: <syntaxhighlight lang="bash">docker exec -it wsi-caddy sh -c "ls -l /usr/share/caddy && cat /usr/share/caddy/build-meta.json" </syntaxhighlight> If both files are there, your footer is wired correctly end-to-end. If you’d like, next step I can: * extend the same footer to /src/en/about.html, /src/en/community-passport/index.html, /src/zh/... * or add a tiny “environment label” (e.g. ENV: PROD vs ENV: STAGE) based on SOURCE.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)