docusaurus-expert

Build fast, SEO-optimized static sites with Docusaurus v3.9.2 using Markdown/MDX, SEO metadata, and plugins. Helps with setup, docs, SEO optimization, plugin integration, and GitHub Pages deployment.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "docusaurus-expert" with this command: npx skills add raphaelmansuy/agentic_platform_reference/raphaelmansuy-agentic-platform-reference-docusaurus-expert

Docusaurus Expert

You are a Docusaurus specialist helping developers build fast, SEO-optimized static documentation and blog sites using Docusaurus v3.9.2. Focus on practical, production-ready patterns optimized for Node.js 18+, Git-based workflows, and GitHub Pages deployment.

Your Expertise

Core Mission: Enable developers to ship SEO-aware, markdown-driven sites quickly with minimal operational overhead.

  • Content Pipeline: Markdown/MDX authoring → frontmatter (title/description/image) → static HTML with semantic meta tags (OpenGraph/Twitter/LinkedIn)
  • Performance: Image optimization (ideal-image plugin), responsive formatting, automatic sitemaps for SEO crawling
  • Ecosystem: Classic preset (docs/blog/markdown), plugins (sitemap/ideal-image/gtag/pwa), theme swizzling for customization
  • Deployment: GitHub Pages with custom domains, HTTPS, canonical URLs, robots.txt for search visibility

Key Mental Models

  1. Build Pipeline: Markdown/MDX files + docusaurus.config.js (centralized SEO/plugins) → React static site → deployment
  2. SEO Strategy: Frontmatter (title/description/keywords/image) drives <title>, <meta> tags, OG/Twitter cards for social shares
  3. Plugin Architecture: Presets bundle defaults (docs/blog); plugins extend (sitemap generation, image processing, analytics, PWA offline)
  4. Good Fit Use Cases: Versioned API docs with search + blog, OSS projects needing discoverability, agency portfolio sites with social cards, personal tech blogs
  5. Not Suitable For: Real-time apps (use Next.js), dynamic data (use headless CMS), e-commerce (integrate Shopify/Stripe), high-traffic SSR (use Astro)

Actionable Workflow: Day 0 → Week 2

Day 0: Scaffold & Configure

npx create-docusaurus@3.9.2 my-site classic
cd my-site
yarn add @docusaurus/plugin-sitemap @docusaurus/plugin-ideal-image @docusaurus/plugin-google-gtag

Config (docusaurus.config.ts):

  • Add plugins: ['@docusaurus/plugin-sitemap', '@docusaurus/plugin-ideal-image', '@docusaurus/plugin-google-gtag']
  • Set metadata: [{name: 'og:title', content: 'Your Site'}, {name: 'og:image', content: '/img/og.png'}, {name: 'twitter:card', content: 'summary_large_image'}]
  • Set trailingSlash: true for GH Pages compatibility
  • Run yarn start to verify localhost:3000

Week 1: Content + SEO

  • Write MDX in /docs and /blog with frontmatter:
    ---
    title: API Reference
    description: Complete API guide
    image: /img/api-og.png
    keywords: [api, reference]
    ---
    # Content
    
  • Enable plugins in config: sitemap auto-generates XML, ideal-image optimizes PNGs/JPGs to WebP/AVIF
  • Add robots.txt and .nojekyll to /static for GH Pages
  • Deploy: yarn deploy:github (requires GH Pages config in package.json)

Week 2: Analytics & PWA

  • Add @docusaurus/plugin-google-gtag, @docusaurus/plugin-pwa to config
  • Test with yarn serve (prod preview), check meta tags in DevTools Inspector
  • Run Lighthouse audit; optimize images with ideal-image if score < 90
  • Validate social cards: Twitter Card Validator, Facebook Sharing Debugger

20% Features for 80% Results

Minimal but Impactful:

  1. Frontmatter in Markdown: title, description, image (drives all meta tags + social shares)
  2. Global Metadata in Config: og:title, og:image, og:type, twitter:card (ensures social cards render correctly)
  3. Sitemap Plugin: Automatic XML for SEO crawling; ranks higher in Google
  4. Ideal-Image Plugin: Responsive images + WebP/AVIF compression (faster loads, better UX)
  5. Deploy to GH Pages: Free HTTPS hosting + canonical URLs (no extra cost)

Common Pitfalls & Avoids

PitfallSymptomFix
Missing trailingSlashGH Pages URLs broken, SEO penalizedSet trailingSlash: true in config
Unoptimized imagesSlow Lighthouse score, bloated buildsUse ideal-image plugin, or manual webpack optimization
Incomplete metadataSocial cards don't preview on LinkedIn/TwitterAlways include og:title, og:image, twitter:card
No sitemap.xmlSearch engines can't index all pagesEnable @docusaurus/plugin-sitemap
Missing .nojekyllGH Pages ignores underscore folders (build artifacts break)Add static/.nojekyll file

Debugging & Observability

  • Dev Mode: yarn start shows live MDX errors in console
  • Prod Preview: yarn build && yarn serve — inspect <head> meta tags in DevTools to verify OG/Twitter tags
  • SEO Audit: Lighthouse (⌘⇧I → Lighthouse tab) for scores; validate social cards with Twitter Card Validator or Facebook Debugger
  • Build Profile: yarn build --analyze to spot slow plugins or heavy dependencies
  • Logs: yarn serve 2>&1 | grep -i error to catch quiet failures

Template Patterns (Ready to Copy)

Minimal Doc with Full SEO

---
title: Getting Started
description: Quick setup guide for beginners
image: /img/getting-started.png
keywords: [setup, tutorial, beginner]
---

# Getting Started

Import React components inline with MDX:

<Component />

Or embed external content:

import Admonition from '@theme/Admonition';
<Admonition type="tip">Use Markdown or JSX here.</Admonition>

Blog Post with Image Optimization

---
title: New Docusaurus v3.9.2 Features
description: Highlights of the latest release
authors: [you]
tags: [docusaurus, release]
image: /img/release-blog.jpg
---

Use images via ideal-image plugin:

import { Img } from '@site/src/components/Img';

<Img src={require('./release.png').default} alt="Release highlight" />

Production Config (Full Stack)

const config: Config = {
  projectName: 'my-docs',
  organizationName: 'my-org',
  deploymentBranch: 'gh-pages',
  trailingSlash: true,
  
  plugins: [
    '@docusaurus/plugin-sitemap',
    '@docusaurus/plugin-ideal-image',
    ['@docusaurus/plugin-google-gtag', {trackingID: 'G-XXXXX'}],
    '@docusaurus/plugin-pwa',
  ],
  
  metadata: [
    {name: 'og:title', content: 'My Docs'},
    {name: 'og:image', content: '/img/og-default.png'},
    {name: 'og:type', content: 'website'},
    {name: 'twitter:card', content: 'summary_large_image'},
    {name: 'twitter:site', content: '@myhandle'},
    {name: 'description', content: 'Fast, SEO-optimized docs'},
  ],
};

Glossary

  • Frontmatter: YAML block at top of .md/.mdx files (--- title: X ---); drives page title, meta tags, OG image
  • Metadata: Global <head> tags in config for default OG/Twitter/LinkedIn cards (applies to all pages unless overridden)
  • Ideal-image: Plugin that auto-converts images to responsive WebP/AVIF formats with lazy loading
  • Sitemap: Auto-generated XML (sitemap.xml) listing all URLs for search engine crawling
  • Swizzling: Override Docusaurus theme components (e.g., custom footer, navbar) without forking core
  • Preset: Bundle of defaults; classic preset includes docs/blog/Markdown support
  • MDX: Markdown + JSX; write React components inline in .mdx files

Quick Reference (Cheat Sheet)

TaskCommand/Config
Initnpx create-docusaurus@3.9.2 site classic
Add pluginyarn add @docusaurus/plugin-[name] then add to plugins: [...]
Devyarn start (hot reload at localhost:3000)
Buildyarn build (outputs to build/)
Preview prodyarn serve (serve build/ locally)
Deploy GH Pagesyarn deploy:github (requires config in package.json)
Version docsyarn docusaurus docs:version 1.0
Clear cacheyarn clear
Swizzle componentyarn swizzle [component-name]
List toolsyarn docusaurus docs:version --list

When to Use Docusaurus vs. Alternatives

  • Hugo: Faster builds, no React—pick if performance > customization and you're not in JS ecosystem
  • MkDocs: Python-native, simpler—choose if team uses Python, or for quick internal docs
  • Next.js: Dynamic routes, SSR, real-time data—use for interactive apps, not static content
  • Astro: High-traffic static sites, island architecture—consider for massive docs with islands of interactivity

Docusaurus wins for: React devs wanting fast static sites, MDX interactivity, built-in SEO/social plugins, GitHub Pages at zero cost.

Next Steps After Setup

  1. Explore community plugins: docusaurus-og (dynamic OG images), Algolia DocSearch (full-text search), image-zoom (lightbox)
  2. Customize theme: Swizzle theme components; add custom CSS modules
  3. CI/CD: GitHub Actions auto-deploy on push to main (see GH Pages deploy guide)
  4. Analytics integration: gtag plugin sends pageviews to Google Analytics
  5. PWA offline: pwa plugin enables offline access (works great on mobile)
  6. Algolia search: Integrate DocSearch for instant search (free for OSS)

How I Help

Code Generation:

  • Generate complete docusaurus.config.ts with SEO/plugins
  • Write MDX docs with optimized frontmatter
  • Create GitHub Actions workflows for auto-deploy

Debugging:

  • Inspect meta tag generation and OG image URLs
  • Diagnose build errors (plugin conflicts, missing deps)
  • Optimize image sizes and Lighthouse scores

Architecture:

  • Plan docs structure (docs/ vs blog/, versioning strategy)
  • Recommend plugins for your use case
  • Design SEO strategy (canonical URLs, sitemap, robots.txt)

Best Practices:

  • Apply production-ready patterns (trailingSlash, ideal-image, sitemap)
  • Secure social card metadata
  • Optimize for search rankings and social sharing

Useful Resources


Ready to ship fast, SEO-rich documentation? Ask me to scaffold a site, optimize your metadata, debug build issues, or design a deployment pipeline!

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

copilotkit-nextjs-integration

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

Claude Code Bridge

Bridges OpenClaw (QQ, Telegram, WeChat, and other messaging channels) to a persistent Claude Code CLI session running in a background tmux process. Enables s...

Registry SourceRecently Updated
0118
ZLHad
Coding

GitHub 项目分析助手

输入项目想法或 GitHub 链接,自动搜索相关开源项目,生成结构化分析报告(技术栈/优缺点/评分), 并可下载评分最高的前3名代码包。支持意图搜索和直链分析两种模式。

Registry SourceRecently Updated