mkdocs-ultralytics-plugin 0.2.5


pip install mkdocs-ultralytics-plugin

  Latest version

Released: Jun 30, 2026


Meta
Author: Glenn Jocher
Maintainer: Ultralytics
Requires Python: >=3.8

Classifiers

Development Status
  • 4 - Beta

Intended Audience
  • Developers
  • Education
  • Science/Research

License
  • OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)

Programming Language
  • Python :: 3
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Topic
  • Software Development
  • Scientific/Engineering
  • Scientific/Engineering :: Artificial Intelligence

Operating System
  • POSIX :: Linux
  • MacOS
  • Microsoft :: Windows

Ultralytics logo

๐Ÿš€ MkDocs Ultralytics Plugin

Welcome to the MkDocs Ultralytics Plugin! ๐Ÿ“„ This powerful tool enhances your MkDocs, Zensical, or any static site documentation with advanced Search Engine Optimization (SEO) features, interactive social elements, and structured data support. It automates the generation of essential meta tags, incorporates social sharing capabilities, and adds JSON-LD structured data to elevate user engagement and improve your documentation's visibility on the web.

Two modes available:

  • ๐Ÿ”Œ Plugin Mode: Real-time processing during MkDocs builds
  • ๐Ÿ”„ Postprocess Mode: Process any generated static site HTML after build

Ultralytics Actions

Ultralytics Discord Ultralytics Forums Ultralytics Reddit

โœจ Features

This tool seamlessly integrates valuable features into your documentation site:

  • Meta Tag Generation: Automatically creates meta description and image tags using the first paragraph and image found on each page, crucial for SEO and social previews.
  • Keyword Customization: Allows you to define specific meta keywords directly within your Markdown front matter for targeted SEO.
  • Social Media Optimization: Generates Open Graph and Twitter Card meta tags to ensure your content looks great when shared on social platforms.
  • Simple Sharing: Inserts convenient share buttons for Twitter and LinkedIn at the end of your content, encouraging readers to share.
  • Git Insights: Gathers and displays Git commit information, including update dates and authors, directly within the page footer for transparency.
  • JSON-LD Support: Adds structured data in JSON-LD format, helping search engines understand your content better and potentially enabling rich results.
  • FAQ Parsing: Automatically parses FAQ sections (if present) and includes them in the structured data for enhanced search visibility.
  • Copy for LLM: Adds a button to copy page content in Markdown format, optimized for sharing with AI assistants.
  • LLMs.txt Generation: Generates an llms.txt index after builds for LLM-friendly site discovery.
  • Customizable Styling: Includes optional inline CSS to maintain consistent styling across your documentation, aligning with themes like MkDocs Material.

๐Ÿ› ๏ธ Installation

PyPI - Version Ultralytics Downloads PyPI - Python Version

Install via pip:

pip install mkdocs-ultralytics-plugin

Or install from source for development:

git clone https://github.com/ultralytics/mkdocs
cd mkdocs
pip install -e .

๐Ÿ’ป Usage

๐Ÿ”Œ Plugin Mode (MkDocs)

Activate the plugin in your mkdocs.yml:

plugins:
  - search
  - ultralytics:
      add_desc: False
      add_image: True
      add_authors: True
      add_json_ld: True
      add_share_buttons: True
      default_image: https://example.com/image.png
      default_author: you@example.com

Then build normally:

mkdocs build
mkdocs serve

๐Ÿ”„ Postprocess Mode (Zensical, Hugo, Jekyll, etc.)

For static site generators that don't support MkDocs plugins, use the standalone postprocess script.

Step 1: Create postprocess.py in your project root:

from plugin import postprocess_site

if __name__ == "__main__":
    postprocess_site(
        site_dir="site",  # Your build output directory
        docs_dir="docs",  # Your source docs directory
        site_url="https://example.com",
        default_image="https://example.com/image.png",
        default_author="you@example.com",
        add_desc=True,
        add_image=True,
        add_authors=True,
        add_json_ld=True,
        add_share_buttons=True,
        add_css=True,
        add_copy_llm=True,
        verbose=True,
    )

Step 2: Build your site and run postprocess:

# For Zensical
zensical build && python postprocess.py

# For MkDocs (without plugin)
mkdocs build && python postprocess.py

# For Hugo
hugo && python postprocess.py

# For Jekyll
jekyll build && python postprocess.py

โš™๏ธ Configuration Options

Both modes support the same configuration options:

Option Type Default Description
verbose bool True Enable detailed console output
enabled bool True Enable/disable processing
default_image str None Fallback image URL for meta tags
default_author str None Default GitHub author email
add_desc bool True Generate meta description tags
add_image bool True Generate meta image tags
add_keywords bool True Generate meta keyword tags
add_share_buttons bool True Add social share buttons
add_authors bool False Display Git author info
add_json_ld bool False Add JSON-LD structured data
add_css bool True Include inline CSS styles
add_copy_llm bool True Add "Copy for LLM" button
add_llms_txt bool True Generate an llms.txt index

๐Ÿงฉ How It Works

The tool processes HTML pages to enhance them with metadata and interactive elements:

Meta Description Generation

Extracts the first paragraph from your content and generates <meta name="description"> tags for SEO.

Meta Image Tagging

Identifies the first image in the content or uses the default image for og:image and twitter:image tags.

Social Share Buttons

Appends pre-styled Twitter and LinkedIn sharing buttons to your content.

Git Information Display

Retrieves Git history to show creation/update dates and author avatars at the bottom of pages.

JSON-LD Structured Data

Generates Article and FAQPage schema for better search engine understanding.

Copy for LLM Button

Adds a button next to the "Edit this page" button that fetches the raw Markdown and copies it to clipboard, perfect for sharing with AI assistants.

๐Ÿ’ก Architecture

The codebase is organized for maximum code reuse:

plugin/
โ”œโ”€โ”€ __init__.py       # Package metadata
โ”œโ”€โ”€ processor.py      # โญ Core HTML processing logic
โ”œโ”€โ”€ main.py          # MkDocs plugin wrapper
โ”œโ”€โ”€ postprocess.py   # Standalone postprocess wrapper
โ””โ”€โ”€ utils.py         # Helper functions

Both plugin mode and postprocess mode use the same process_html() function in processor.py, ensuring identical output regardless of which mode you use.

๐Ÿ“Š Plugin Mode vs Postprocess Mode

Feature Plugin Mode Postprocess Mode
Works with MkDocs only Any static site generator
Processing time During build (per-page) After build (batch)
Configuration mkdocs.yml Python script
Hot reload โœ… Yes โŒ No (rebuild required)
Git info โœ… Yes โœ… Yes
Best for MkDocs projects Zensical, Hugo, Jekyll, etc.

๐Ÿค Contribute

Collaboration fuels innovation! ๐Ÿค— The success of Ultralytics' open-source projects thrives on community contributions. We welcome your involvement, whether it's fixing bugs, proposing new features, improving documentation, engaging in discussions, or sharing how you use Ultralytics tools.

Please see our Contributing Guide for details. Filling out our Survey also provides valuable feedback. We sincerely appreciate ๐Ÿ™‡โ€โ™‚๏ธ every contribution!

Ultralytics open-source contributors

๐Ÿ“œ License

Ultralytics provides two licensing options:

  • AGPL-3.0 License: Ideal for students, researchers, and enthusiasts, this OSI-approved license promotes open collaboration and knowledge sharing. See the LICENSE file for details.
  • Enterprise License: Designed for commercial applications, this license allows seamless integration of Ultralytics software into commercial products, bypassing AGPL-3.0 requirements. Visit Ultralytics Licensing for details.

โœ‰๏ธ Connect with Us

Encountered a bug or have an idea? Visit GitHub Issues to report problems or suggest enhancements. For discussions and community support, join our Discord server and check out Ultralytics Reddit.


Ultralytics GitHub space Ultralytics LinkedIn space Ultralytics Twitter space Ultralytics YouTube space Ultralytics TikTok space Ultralytics BiliBili space Ultralytics Discord
0.2.5 Jun 30, 2026
0.2.4 Dec 18, 2025
0.2.3 Nov 22, 2025
0.2.2 Nov 22, 2025
0.2.1 Nov 13, 2025
0.2.0 Nov 13, 2025
0.1.30 Sep 02, 2025
0.1.29 Aug 26, 2025
0.1.28 Aug 25, 2025
0.1.27 Aug 11, 2025
0.1.26 Aug 02, 2025
0.1.25 Jul 15, 2025
0.1.24 Jul 15, 2025
0.1.23 Jul 15, 2025
0.1.22 Jul 15, 2025
0.1.21 Jul 15, 2025
0.1.20 Jul 08, 2025
0.1.19 May 24, 2025
0.1.18 Apr 24, 2025
0.1.17 Feb 06, 2025
0.1.16 Jan 29, 2025
0.1.15 Dec 08, 2024
0.1.14 Nov 19, 2024
0.1.13 Nov 07, 2024
0.1.12 Oct 19, 2024
0.1.11 Oct 16, 2024
0.1.10 Oct 05, 2024
0.1.9 Sep 22, 2024
0.1.8 Aug 31, 2024
0.1.7 Aug 31, 2024
0.1.6 Aug 30, 2024
0.1.5 Aug 17, 2024
0.1.4 Aug 17, 2024
0.1.3 Aug 13, 2024
0.1.2 Aug 09, 2024
0.1.1 Aug 09, 2024
0.1.0 Aug 09, 2024
0.0.50 Aug 08, 2024
0.0.49 Jul 04, 2024
0.0.48 Jun 16, 2024
0.0.47 Jun 09, 2024
0.0.46 Jun 09, 2024
0.0.45 May 31, 2024
0.0.44 Feb 20, 2024
0.0.43 Feb 03, 2024
0.0.42 Jan 27, 2024
0.0.41 Jan 27, 2024
0.0.40 Jan 24, 2024
0.0.39 Jan 24, 2024
0.0.38 Jan 21, 2024
0.0.37 Jan 14, 2024
0.0.36 Jan 14, 2024
0.0.35 Dec 26, 2023
0.0.34 Nov 19, 2023
0.0.33 Nov 11, 2023
0.0.32 Nov 02, 2023
0.0.31 Oct 30, 2023
0.0.30 Oct 21, 2023
0.0.29 Oct 04, 2023
0.0.28 Oct 04, 2023
0.0.27 Aug 29, 2023
0.0.26 Aug 26, 2023
0.0.25 Aug 05, 2023
0.0.24 Aug 02, 2023
0.0.23 Jul 29, 2023
0.0.22 Jul 29, 2023
0.0.21 Jun 18, 2023
0.0.20 Jun 18, 2023
0.0.19 May 12, 2023
0.0.17 May 10, 2023
0.0.16 May 10, 2023
0.0.15 May 09, 2023
0.0.14 May 09, 2023
0.0.13 May 09, 2023
0.0.12 May 09, 2023
0.0.11 May 08, 2023
0.0.10 May 08, 2023
0.0.9 May 08, 2023
0.0.8 May 08, 2023
0.0.7 May 08, 2023
0.0.6 May 08, 2023
0.0.5 May 08, 2023
0.0.4 May 08, 2023
0.0.3 May 08, 2023
0.0.2 May 08, 2023
0.0.1 May 08, 2023
Extras:
Dependencies:
mkdocs (>=1.0)
beautifulsoup4 (>=4.13.5)
pyyaml
requests (>=2.28.1)