Skip to content

fix(web): migrate blog to the Marble SDK - #476

Open
taqh wants to merge 1 commit into
analogdotnow:mainfrom
taqh:fix/marble-sdk-auth
Open

taqh wants to merge 1 commit into
analogdotnow:mainfrom
taqh:fix/marble-sdk-auth

Conversation

@taqh

@taqh taqh commented Oct 20, 2026 •

Copy link
Copy Markdown

Description

Use @usemarble/sdk for the blog instead of the deprecated workspace-ID API routes. The SDK returns typed posts with real Date values, so the copied response types and the unused tag, category and author queries are removed (net −146 lines). Every page of posts is now loaded, and missing cover or author images no longer break rendering.

MARBLE_WORKSPACE_KEY and MARBLE_API_URL are replaced by an optional MARBLE_API_KEY (a public key with read access). With no key the blog shows "No blog posts found", as before. An unknown slug returns a 404. Other API errors still surface.

The unused attribution block is removed because the Marble API has no attribution field.

Type of Change

  • Bug fix
  • Refactor / Cleanup

Related Areas

  • Data/API

Testing

  • Manual testing performed

bun run type-check, bun run lint and format:check pass. A production build served blog, post, sitemap and 404 routes correctly with both empty and populated (two-page) API fixtures. I had no live key, so no real API call was made. Browser screenshots were unavailable.

Checklist

  • I’ve read the CONTRIBUTING guide
  • My code works and is understandable and follows the project's style guidelines
  • I have performed a self-review of my code
  • I have updated the documentation

By submitting, I confirm I understand and stand behind this code. If AI was used, I’ve reviewed and verified everything myself.


Summary by cubic

Migrates the blog to @usemarble/sdk, replacing the deprecated workspace-ID API routes.

  • MARBLE_WORKSPACE_KEY and MARBLE_API_URL are replaced by an optional MARBLE_API_KEY; with no key the blog shows "No blog posts found", as before, and unknown slugs return a 404.
  • The SDK's typed responses with real Date values replace the copied response types, and the unused tag, category, and author queries are removed (net −146 lines).
  • All pages of posts are now loaded, and missing cover or author images no longer break rendering.
  • The attribution block is removed because the Marble API has no attribution field.

Written for commit ab332dd. Summary will update on new commits.

View guided diff

Use @usemarble/sdk with a public read key instead of the deprecated workspace-ID API routes. Drop the copied response types and the unused tag, category and author queries, load every posts page, and guard nullable cover and author images.
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@taqh is attempting to deploy a commit to the Analog Interface Team on Vercel.

A member of the Team first needs to authorize it.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-20T15:40:12.825761Z ab332dd PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 11 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/web/src/app/(marketing)/blog/[slug]/page.tsx">

<violation number="1" location="apps/web/src/app/(marketing)/blog/[slug]/page.tsx:40">
P2: When `coverImage` is missing, `images: undefined` drops the Analog default share image. The page's `openGraph` and `twitter` objects replace the root layout's, so the post emits no og:image or twitter:image. Fall back to the layout's `ogImage` in both blocks.</violation>
</file>

<file name="apps/web/src/app/(marketing)/blog/page.tsx">

<violation number="1" location="apps/web/src/app/(marketing)/blog/page.tsx:109">
P3: This map can show a later author’s avatar next to the first author’s name when the first author has no image. Preserve the author slot with a fallback, or only render avatars that remain correctly associated with the displayed author.</violation>
</file>

Reply to a comment to ask cubic a question or push back. It learns from your replies.

View guided diff | Re-trigger cubic

alt: data.post.title,
},
],
images: post.coverImage ? [post.coverImage] : undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: When coverImage is missing, images: undefined drops the Analog default share image. The page's openGraph and twitter objects replace the root layout's, so the post emits no og:image or twitter:image. Fall back to the layout's ogImage in both blocks.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/web/src/app/(marketing)/blog/[slug]/page.tsx, line 40:

<comment>When `coverImage` is missing, `images: undefined` drops the Analog default share image. The page's `openGraph` and `twitter` objects replace the root layout's, so the post emits no og:image or twitter:image. Fall back to the layout's `ogImage` in both blocks.</comment>

<file context>
@@ -29,44 +28,24 @@ export async function generateMetadata({
-          alt: data.post.title,
-        },
-      ],
+      images: post.coverImage ? [post.coverImage] : undefined,
     },
     openGraph: {
</file context>

{post.authors
.slice(0, 2)
.map((author) =>
author.image ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: This map can show a later author’s avatar next to the first author’s name when the first author has no image. Preserve the author slot with a fallback, or only render avatars that remain correctly associated with the displayed author.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/web/src/app/(marketing)/blog/page.tsx, line 109:

<comment>This map can show a later author’s avatar next to the first author’s name when the first author has no image. Preserve the author slot with a fallback, or only render avatars that remain correctly associated with the displayed author.</comment>

<file context>
@@ -106,16 +103,20 @@ export default async function BlogPage() {
+                              {post.authors
+                                .slice(0, 2)
+                                .map((author) =>
+                                  author.image ? (
+                                    <Image
+                                      key={author.id}
</file context>
Suggested change
author.image ? (
author.image && author.id === post.authors[0]?.id ? (

This branch has not been deployed

No deployments
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