Skip to content

Commit 3361692

Browse files
committed
fix: include basePath in metadataBase for OG image
1 parent 6397340 commit 3361692

3 files changed

Lines changed: 57 additions & 1 deletion

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ extension:
2626
wasm:
2727
GOOS=js GOARCH=wasm go build -ldflags="-s -w" -trimpath -o gnata.wasm ./wasm/
2828
cp "$$(go env GOROOT)/lib/wasm/wasm_exec.js" wasm_exec.js
29+
# -gc=leaking ?
2930
tinygo build -o gnata-lsp.wasm -no-debug -gc=conservative -target wasm ./editor/
3031
cp "$$(tinygo env TINYGOROOT)/targets/wasm_exec.js" lsp-wasm_exec.js
3132

deploy-check.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
set -e
3+
4+
MSG="${1:-fix og-image}"
5+
6+
# Stage and commit
7+
git add -A
8+
git commit -m "$MSG" || { echo "Nothing to commit"; exit 0; }
9+
git push
10+
11+
# Wait for workflow to start
12+
echo "Waiting for workflow to start..."
13+
sleep 5
14+
15+
# Get the latest run ID
16+
RUN_ID=$(gh run list --limit 1 --json databaseId --jq '.[0].databaseId')
17+
echo "Watching run $RUN_ID..."
18+
19+
# Wait for it to finish
20+
gh run watch "$RUN_ID" --exit-status || { echo "Build failed!"; gh run view "$RUN_ID" --log-failed; exit 1; }
21+
22+
echo ""
23+
echo "=== Deploy complete. Checking OG image ==="
24+
echo ""
25+
26+
# Check what meta tag says
27+
echo "--- Meta tags ---"
28+
curl -sL https://rbby.dev/gnata-sqlite/ | grep -i 'og:image' | head -5 || echo "(no og:image found)"
29+
30+
echo ""
31+
32+
# Extract OG image URL (macOS-compatible)
33+
OG_URL=$(python3 -c "
34+
import re, urllib.request
35+
html = urllib.request.urlopen('https://rbby.dev/gnata-sqlite/').read().decode()
36+
m = re.search(r'og:image\" content=\"([^\"]+)\"', html)
37+
print(m.group(1) if m else '')
38+
")
39+
40+
if [ -n "$OG_URL" ]; then
41+
echo "OG image URL: $OG_URL"
42+
STATUS=$(curl -sL -o /dev/null -w "%{http_code}" "$OG_URL")
43+
CONTENT_TYPE=$(curl -sL -o /dev/null -w "%{content_type}" "$OG_URL")
44+
echo "HTTP status: $STATUS"
45+
echo "Content-Type: $CONTENT_TYPE"
46+
if [ "$STATUS" = "200" ] && echo "$CONTENT_TYPE" | grep -q "image"; then
47+
echo "OG image is working!"
48+
else
49+
echo "OG image is NOT working"
50+
fi
51+
else
52+
echo "Could not extract og:image URL"
53+
fi

website/src/app/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { Provider } from '@/components/provider';
33
import type { Metadata } from 'next';
44
import './global.css';
55

6+
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || '';
7+
68
export const metadata: Metadata = {
7-
metadataBase: new URL('https://rbby.dev'),
9+
metadataBase: new URL(`https://rbby.dev${basePath}`),
810
};
911

1012
const onest = Onest({

0 commit comments

Comments
 (0)