fix(web): migrate blog to the Marble SDK

TA
2mo ago
+85-231

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.