Skip to content

Phase 1: blog migration to markdown + Astro#2143

Merged
bpamiri merged 12 commits into
developfrom
peter/phase-1-blog
Apr 17, 2026
Merged

Phase 1: blog migration to markdown + Astro#2143
bpamiri merged 12 commits into
developfrom
peter/phase-1-blog

Conversation

@bpamiri

@bpamiri bpamiri commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Imports 150 posts from the wheels.dev CFWheels DB (CockroachDB blog_posts table) into markdown at web/content/blog/posts/
  • Paginated blog home (10 posts/page) + 150 post detail pages + 58 tag pages + tag index + RSS feed + sitemap
  • Giscus comments on every post (GitHub Discussions, 'Blog Comments' category)
  • Buttondown newsletter signup on every page (username wheelsdev)
  • Total: 223 generated pages

Migration approach

One-shot script at wheels-dev/wheels.dev/migration/ (not committed — wheels.dev is being archived in Phase 5). Script queried the DB, joined with users/tags/categories, converted HTML → markdown via turndown+gfm, emitted one .md per post with frontmatter.

Known issue — broken legacy images

All blog post bodies reference cfwheels.org/* image URLs that now 301-redirect to wheels.dev/. Every post ships with broken inline images. Recovery is a follow-up (Wayback Machine scrape into web/sites/blog/public/blog-images/). This is accepted debt for Phase 1 launch.

Test plan

  • All 150 posts build without errors
  • /posts/[slug], /tags/[tag], /page/[page], /rss.xml, /sitemap-index.xml all render
  • pnpm format:check + astro check pass
  • Preview deploy succeeds
  • Preview URL serves home, a post, a tag page, and /rss.xml with expected content
  • Giscus loads on a post (the GitHub Discussions threads get auto-created on first visit)
  • Buttondown form submits (smoke test — subscribe+unsubscribe)

What's next

Phase 2 generates API reference from docs/api/v*.json into the api.wheels.dev Starlight site.

bpamiri added 12 commits April 17, 2026 13:14
One-shot migration from the CFWheels wheels.dev blog_posts table.
HTML content was converted to markdown via turndown + gfm plugin.
Each post has frontmatter with title, slug, publishedAt, author,
tags, categories, excerpt, coverImage, and legacyId.

Images moved from wheels.dev/public/images to
web/sites/blog/public/blog-images, with original cfwheels.org
URLs preserved in post bodies.

Migration script lives in wheels-dev/wheels.dev/migration/ — not
checked in to this repo, since it's a one-shot and wheels.dev is
being archived.
…overy

Post-mortem on Task 6: the 75 images copied from wheels.dev/public/images/
are orphaned — zero blog posts reference them via body markdown or
coverImage frontmatter. They were landing/admin UI assets, not blog
content.

Meanwhile, every post body references https://cfwheels.org/... image
URLs that now 301 to wheels.dev/ — those are all currently broken.
Wayback Machine recovery is a follow-up after Phase 1 ships.

Leaves an empty blog-images/ directory (via .gitkeep) as the target
for recovered images.
References the shared ../../content/blog/posts directory so
content lives at the monorepo root rather than inside the blog
site. Zod schema validates each post's frontmatter.
getAllPosts sorts by publishedAt desc; getAllTags returns a
tag→count Map for the tags index; getPostsByTag filters; formatDate
formats for display. All thin wrappers around Astro's getCollection.
PostLayout composes title/meta/tags/cover/body around a slot for
rendered markdown. The [slug].astro dynamic route uses
getStaticPaths to pre-render every entry in the posts collection.
Index shows the 10 newest posts; /page/2/ through /page/N/ cover
older posts. PostCard component is reused here and on tag pages.
/tags/ lists every tag with post counts, sorted by popularity.
/tags/[tag]/ lists posts filtered to that tag.
All posts in the collection, newest first, with tag categories
and excerpt as description. @astrojs/rss handles feed validity.
Comments are backed by GitHub Discussions on wheels-dev/wheels in
the 'Blog Comments' category. Mapping uses pathname so each post
has its own thread. Users sign in with GitHub.
Embedded form posts to buttondown.com. Appears on every page
above the site footer. Username 'wheelsdev' — update if the
Buttondown handle changes.
@github-actions github-actions Bot added docs dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Apr 17, 2026
@bpamiri
bpamiri merged commit 6a696ee into develop Apr 17, 2026
6 of 7 checks passed
@bpamiri
bpamiri deleted the peter/phase-1-blog branch April 17, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file docs javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant