Conversation
Serve blog images from the site domain
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
indopensource-org | 79c136c | Commit Preview URL Branch Preview URL |
Jul 23 2026, 05:39 PM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79c136ca49
ℹ️ 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}`; |
There was a problem hiding this comment.
Emit absolute image URLs in article JSON-LD
Returning root-relative paths here changes post.thumbnail from an absolute raw URL to /blog-assets/...; checked src/components/BlogArticlePage.astro and it still puts thumbnailUrl directly into jsonLd.image, while BaseLayout only normalizes the separate OG/Twitter image prop. For every mirrored article, the emitted BlogPosting JSON-LD therefore contains a relative image URL, which can make structured-data image discovery fail even though the meta tags are correct; normalize the JSON-LD image against the site origin.
Useful? React with 👍 / 👎.
| const resolved = resolveThumbnail(value, articlePath, branch); | ||
| if (!resolved.startsWith(`https://raw.githubusercontent.com/${BLOG_REPO}/`)) return resolved; | ||
|
|
||
| const assetName = new URL(resolved).pathname.split('/').pop()?.replace(/[^A-Za-z0-9._-]/g, ''); |
There was a problem hiding this comment.
Preserve source path in mirrored asset names
Because assetName keeps only the final path segment, two different source assets in the same article month with common names like cover.jpg or image.png are both written to the same public/blog-assets/YYYY/MM/<name> path and then both posts point at that same URL. The later fetch in the sync loop overwrites the earlier file, so one article renders the wrong thumbnail/body image; include the slug/source path or a hash in the mirrored filename.
Useful? React with 👍 / 👎.
Release
Promote the same-origin blog image and Open Graph metadata changes from
mainto production.Included
indopensource.org/blog-assetsValidation