Skip to content

Serve blog images from the site domain#52

Merged
wauputr4 merged 1 commit into
mainfrom
agent/blog-same-origin-images
Jul 23, 2026
Merged

Serve blog images from the site domain#52
wauputr4 merged 1 commit into
mainfrom
agent/blog-same-origin-images

Conversation

@wauputr4

Copy link
Copy Markdown
Member

What changed

  • mirror every article thumbnail and inline Blog-IndopenSource image into /blog-assets during sync
  • emit Open Graph image width, height, and MIME type metadata
  • use source dimensions on article hero images
  • sync metadata and same-origin assets for all six article records
  • add a regression check covering local assets, metadata, and raw GitHub URLs

Root cause

Article images were rendered from raw.githubusercontent.com. Social crawlers and browsers could fail or cache that external response, leaving a blank hero and an unreliable OG preview.

Impact

All blog images now load from indopensource.org; the OpenClaw OG image is 1200x630 (~160 KB), and its inline image is reduced from 6.3 MB to ~372 KB.

Validation

  • npm test (23 tests passed)
  • npm run build (113 pages, no diagnostics)
  • local browser verification of the English OpenClaw article

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@wauputr4, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 74d68077-ec52-43c8-ac72-5b9ae904f2b9

📥 Commits

Reviewing files that changed from the base of the PR and between 60c60cd and 01d9e2e.

⛔ Files ignored due to path filters (7)
  • public/blog-assets/2026/06/memperkenalkan-blog-indopensource.jpg is excluded by !**/*.jpg
  • public/blog-assets/2026/07/it-camp-2026.jpg is excluded by !**/*.jpg
  • public/blog-assets/2026/07/model-ekonomi-pusat-yayasan-it.jpg is excluded by !**/*.jpg
  • public/blog-assets/2026/07/onno-w-purbo.png is excluded by !**/*.png
  • public/blog-assets/2026/07/openclaw-jakarta-meetup-5-body.jpg is excluded by !**/*.jpg
  • public/blog-assets/2026/07/openclaw-jakarta-meetup-5-og.jpg is excluded by !**/*.jpg
  • public/blog-assets/2026/07/wajanbolic-onno-w-purbo.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • scripts/sync-blog-posts.mjs
  • src/components/BlogArticlePage.astro
  • src/data/blog-posts.json
  • src/layouts/BaseLayout.astro
  • src/lib/content.ts
  • test/lib.test.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/blog-same-origin-images

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
indopensource-org 01d9e2e Commit Preview URL

Branch Preview URL
Jul 23 2026, 05:37 PM

@wauputr4
wauputr4 merged commit 79c136c into main Jul 23, 2026
3 checks passed
@wauputr4
wauputr4 deleted the agent/blog-same-origin-images branch July 23, 2026 17:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01d9e2ee63

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


await mkdir(assetDirectory, { recursive: true });
await writeFile(new URL(assetName, assetDirectory), Buffer.from(await response.arrayBuffer()));
return `/blog-assets/${year}/${month}/${assetName}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Respect ASTRO_BASE for mirrored body images

When the site is built with a non-root base path, such as the CI build's ASTRO_BASE=/indopensource.org, this root-relative URL is inserted verbatim into article content by mirrorContentAssets; that HTML is later emitted through set:html, so unlike hero thumbnails it never passes through withBase. Inline blog images therefore request /blog-assets/... from the domain root instead of /<base>/blog-assets/... and break on sub-path previews/forks. Store a base-aware URL or rewrite body image src values during render.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant