Lovablefeatureintermediate

Add Blog Section to Lovable App

Add a blog with posts, categories, RSS feed, and Article schema for SEO.

What you'll get

A complete blog section with post listing, detail pages, categories, RSS feed, and Article schema.

The Prompt

Add a blog section to my Lovable app.

REQUIREMENTS:
1. Create a /blog page listing all published posts in reverse chronological order. Each post card shows: featured image, title, excerpt (first 150 chars), author, date, category badge, and reading time.
2. Create a /blog/[slug] detail page with: title, featured image, author with avatar, publish date, reading time, category, full content rendered as rich text, and social sharing buttons (Twitter, LinkedIn, copy link).
3. Add category filtering on the blog listing page with category chips.
4. Add an RSS feed at /rss.xml that lists the 20 most recent posts.
5. Add Article structured data (JSON-LD) on each blog post page.
6. Add a "Related Posts" section at the bottom of each post showing 3 posts from the same category.
7. Add a simple admin editor for creating/editing posts with title, slug, content (markdown or rich text), featured image, category, and publish/draft toggle.

DATABASE:
- "blog_posts" table: id, title, slug (unique), content, excerpt, featured_image, author_id, category, status (draft/published), reading_time, published_at, created_at, updated_at
- "blog_categories" table: id, name, slug, color
- RLS: Anyone can read published posts. Only admins can create/edit.

SECURITY:
- Sanitize HTML content to prevent XSS.
- Validate slugs to prevent path traversal.

Replace these variables

VariableReplace with
[CATEGORIES]Blog categories (e.g., tutorials, news, case studies)
[AUTHOR_FIELDS]Author info to display (name, avatar, bio)

Tips for best results

Generate reading time by counting words and dividing by 200 (average reading speed).

Use dynamic OG images for social sharing — they significantly increase click-through rates.

Follow-up prompts

Add comments

Add a comment system to blog posts. Authenticated users can leave comments, and admins can moderate (approve/delete). Use a "blog_comments" table.

Add newsletter

Add a newsletter signup form at the bottom of each blog post. Store subscribers in a "newsletter_subscribers" table and send new post notifications via Resend.

Related prompts