Lovable prompt to build a blog with a CMS
Instead of bolting a headless CMS onto a static site, this prompt has Lovable build both halves in one project, a public blog reading published posts and an admin editor gated by an editor flag. You end up with markdown authoring, cover image uploads, and slugged post pages without a second service to deploy.
Last updated
Build a blog with an admin CMS in one app. Public side: a home page listing published posts newest first with cover image, title, excerpt, and tag chips, a post page at /blog/[slug] rendering markdown with code highlighting, and a tag page filtering the list. Each post page sets its document title and description from the post record. Admin side: routes under /admin gated by Supabase auth plus an is_editor flag on a profiles table, a posts list showing draft or published status, and an editor screen with title, a slug auto-generated from the title but editable, a markdown body with live preview, a tag picker, and a cover image uploaded to a covers storage bucket. Data model: posts with a unique slug, status, published_at, author_id, and a tags array, with row level security allowing public reads of published rows only and writes for editors only. Behaviors: save keeps drafts private, publish stamps published_at, unpublish returns a post to draft without deleting anything, and slug collisions get a numeric suffix. States: an empty state on the public home when nothing is published yet, a 404 page for unknown slugs, and an editor warning before navigating away with unsaved changes. Styling: a readable measure around 68 characters for post bodies, serif headings, and quiet admin chrome so the editor feels like a document, not a dashboard. Acceptance: a draft is invisible when signed out, publishing makes it appear without any redeploy, an unknown slug 404s cleanly, and a non-editor account cannot open /admin or write to posts.
Same task in other tools
Questions about this prompt
Does the public side render markdown at request time?
Lovable apps render client-side, so markdown converts in the browser on each view. If you need crawler-friendly HTML for posts, say so explicitly and have it render converted content directly rather than behind a loading state.
How do I add more editors?
Flip is_editor on their profiles row in the Supabase table view, or ask Lovable for an admin screen that manages the flag. The RLS policies from this prompt already key off it.
Cover images upload fine but show broken links publicly. Why?
The covers bucket is probably private while post pages use plain public URLs. Either make the bucket public, covers are public content anyway, or have Lovable switch the post page to signed URLs.