Skip to content

feat: add Markdown versions of public pages - #12

Merged
celeroncoder merged 3 commits into
masterfrom
bb/make-website-pages-llm-readable-thr_k6wu632u5q
Aug 25, 2026
Merged

feat: add Markdown versions of public pages#12
celeroncoder merged 3 commits into
masterfrom
bb/make-website-pages-llm-readable-thr_k6wu632u5q

Conversation

@celeroncoder

Copy link
Copy Markdown
Owner

What changed

  • serve Markdown versions at /.md, /index.md, /blog.md, and /blog/.md
  • convert Payload Lexical blog content to Markdown, including fenced code blocks
  • advertise each Markdown page with a text/markdown alternate link
  • keep homepage Markdown in sync through shared portfolio content
  • return Markdown 404 and 500 responses with the correct content type

Verification

  • ./node_modules/.bin/tsc --noEmit
  • ./node_modules/.bin/next build
  • HTTP check confirmed .md rewrites return text/markdown and Markdown error bodies

@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
celeroncoder-web Ready Ready Preview Aug 25, 2026 7:27am

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit f54d742.

Comment thread lib/markdown-pages.ts Outdated
@celeroncoder

Copy link
Copy Markdown
Owner Author

Hermes reviewer is reviewing this PR and will post shortly.

@celeroncoder

Copy link
Copy Markdown
Owner Author

FOLLOW-UP · P1: 0 · P2: 1 · P3: 1

P2 · lib/markdown-pages.ts:131-134 (renderBlogPostMarkdown) — Trigger: a post has a heroImage whose url is server-relative (Payload's vercel-blob/media adapter returns paths like /api/media/file/..., and the code already treats non-object heroImages as absent, so both shapes flow through here). Broken behavior: the image is emitted as ![alt](/api/media/file/...) inside a document served from /blog/<slug>.md. Any consumer resolving that link against the document URL (standard Markdown resolution, curl-based scrapers, most LLM fetch pipelines) requests /blog/api/media/file/..., which 404s. Consequence: every post with a hero image ships a broken image reference in exactly the machine-readable surface this PR exists to provide. Fix: run heroImage.url through absoluteUrl(origin, ...) like the other links.

P3 · app/(frontend)/llm-markdown/[[...path]]/route.ts:75-82 — Trigger: a legacy post row with an empty slug (the column is optional in collections/Posts.ts; the auto-slug hook only fills it on new saves). Broken behavior: postMarkdownUrl builds /blog/.md into the home and blog-index listings. Consequence: dead alternate link pointing at a Markdown 404 until the post is re-saved in admin. Low probability given slugs are unique/admin-managed, hence P3.

What else got checked: proxy matcher correctly skips api, admin, _next/*; /.md, /index.md, /blog.md, /blog/<slug>.md all map cleanly through the optional catch-all including trailing-slash and unknown-path cases returning proper 404 Markdown; error responses get no-store plus X-Robots-Tag: noindex; Lexical conversion guards malformed rich text and falls back to a typed 500; blog-index limit of 50 matches the HTML page so no drift between mirrors; component refactor to site-content.ts preserves all copy verbatim (footer GitHub repo URL still points at celeroncoder.tech, pre-existing); new Date().getFullYear() in footer was already suppressHydrationWarning.

Checks: GitGuardian pass; react-doctor and Vercel pending at review time.

verify: curl -s https://<preview>/blog/<slug-with-hero-image>.md | grep '^!\[' — confirm the image URL is absolute, then fetch it and expect 200 instead of 404.

@celeroncoder
celeroncoder merged commit 6e2230b into master Aug 25, 2026
5 checks passed
@celeroncoder
celeroncoder deleted the bb/make-website-pages-llm-readable-thr_k6wu632u5q branch August 25, 2026 07:34
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