skillfed

mkdocs-minify-plugin

An MkDocs plugin to minify HTML, JS or CSS files prior to being written to disk

mkdocs-minify-plugin v0.8.0 1.1M downloads/30d#4,439 on PyPI195
Permissive license MIT DORMANT released

What it is and what it does

mkdocs-minify-plugin is an MkDocs plugin that automatically minifies HTML, JavaScript, and CSS assets during the documentation build process. It delegates minification to three specialized libraries: htmlmin2 for HTML, jsmin for JavaScript, and csscompressor for CSS. The plugin integrates into MkDocs' build pipeline and can be configured to minify specific file types or all three, with options to add cache-busting hashes to file names and to customize HTML minification behavior.

The plugin is useful when you want to reduce the size of generated documentation without manually running separate minification tools. It supports glob patterns for file selection and can automatically update references to minified files in your HTML output. The package is stable but dormant—last updated in early 2024—and carries no known security vulnerabilities.

Use it for:

  • Reduce documentation site size and bandwidth for static MkDocs sites deployed to CDNs or hosting with bandwidth limits.
  • Add cache-busting hashes to CSS and JS files to ensure browsers fetch fresh versions after updates.
  • Automatically minify all HTML output from MkDocs without manual post-processing steps.
  • Minify custom JavaScript and CSS files included in your documentation theme or configuration.
  • Optimize documentation builds for low-bandwidth environments or mobile-first delivery.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Minifies HTML, JavaScript, and CSS files in MkDocs documentation builds before writing them to disk, reducing output size.

Yes, if you use MkDocs and want to reduce output size without extra build steps. Install friction is low, dependencies are stable, and there are no known vulnerabilities. The dormant maintenance status is not a blocker for a simple, focused plugin, but be aware that bug fixes or feature updates are unlikely. Suitable for production documentation builds.

Install

mkdocs-minify-plugin on PyPI

pip

pip install mkdocs-minify-plugin

uv

uv add mkdocs-minify-plugin

poetry

poetry add mkdocs-minify-plugin

Installing mkdocs-minify-plugin

Before you install

Low friction install with a pure-Python wheel and four straightforward runtime dependencies. Maintenance is dormant—last release was 2024-01-29 and no commits since 2024-02-07—but the package is not archived and has no known vulnerabilities.

License in practice

MIT license is permissive; you can use this package freely in commercial or private projects with minimal restrictions.

Quickstart

pip install mkdocs-minify-plugin

In mkdocs.yml:
plugins:
  - minify:
      minify_html: true
      minify_js: true
      minify_css: true
      js_files:
        - path/to/file.js
      css_files:
        - path/to/file.css

Requires MkDocs to be installed and an active mkdocs.yml configuration file in your project.

Verify before relying

  • Whether minification performance impact is measurable on large documentation sites.
  • Compatibility with recent MkDocs versions beyond those listed in classifiers (3.10, 3.11).

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 4 — mkdocs, htmlmin2, jsmin, csscompressor
Maintenance dormant — 928 days since the last release
Last repo commit
First released
Downloads 1,052,748/month — #4,439 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mkdocs_minify_plugin-0.8.0-py3-none-any.whl

Keywords: mkdocs, minify, publishing, documentation, html, css

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

mkdocs html minificationminify css javascript mkdocsdocumentation build optimizationreduce html css js sizemkdocs plugin minifystatic site size reductionmkdocs build compression
mkdocs-pluginbuild-optimizationstatic-site

More Documentation packages