Meta Description Generator - Quick Start

Generate unique, SEO-optimized meta descriptions for all ITBlogPros posts using FREE Google Gemini Flash API.

🎯 The Problem

✨ The Solution

FREE AI-powered generator with:

🚀 Quick Start (5 Minutes)

1. Get FREE API Key

Visit: https://makersuite.google.com/app/apikey

2. Install Dependencies

npm install @google/generative-ai gray-matter fs-extra

3. Set API Key

PowerShell:

$env:GEMINI_API_KEY="your-api-key-here"

CMD:

set GEMINI_API_KEY=your-api-key-here

Or edit line 28 in script:

const genAI = new GoogleGenerativeAI('your-api-key-here');

4. Test & Run

# Test with 1 post
node generate-meta-descriptions-gemini.js --test

# Preview 10 posts (no changes)
node generate-meta-descriptions-gemini.js --limit=10

# Run for real (updates files)
node generate-meta-descriptions-gemini.js --write

📊 What Happens

Processing 558 posts...
✓ Successfully generated: 408
⊘ Skipped (already good): 150
✗ Errors: 0
⏱  Time: ~12 minutes
💰 Cost: $0.00

🛡️ Safety Features

🆘 If Interrupted

node generate-meta-descriptions-gemini.js --resume --write

📁 Scripts Included

⚠️ CRITICAL: Fix URL Duplicates

After generating descriptions, update posts/posts.json:

{
  "layout": "layout.njk",
  "tags": "post",
  "permalink": "/posts/README/"
}

Create _redirects file:

/2025/:month/:day/*  /posts/2025-:month-:day-:splat 301
/2024/:month/:day/*  /posts/2024-:month-:day-:splat 301
/2023/:month/:day/*  /posts/2023-:month-:day-:splat 301
/2022/:month/:day/*  /posts/2022-:month-:day-:splat 301
/2021/:month/:day/*  /posts/2021-:month-:day-:splat 301

Update .eleventy.js:

eleventyConfig.addPassthroughCopy("_redirects");

Rebuild:

npx @11ty/eleventy

✅ Validate Results

node validate-meta-descriptions.js

Should show: ✅ All meta descriptions are valid!

📚 Full Documentation

🔧 Troubleshooting

"Cannot find module"

npm install @google/generative-ai gray-matter fs-extra

"API key not set"

$env:GEMINI_API_KEY="your-key"

Script interrupted

node generate-meta-descriptions-gemini.js --resume --write

📈 Expected Results

🎯 Success Checklist


Time: 15-20 minutes total
Cost: $0.00
Impact: Moderate to significant SEO improvement

🚀 Let's get started!