1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-12-01 02:27:17 +01:00
mkdocs-material/docs/plugins/minification.md

43 lines
1.0 KiB
Markdown
Raw Normal View History

---
template: overrides/main.html
---
2020-03-09 19:03:48 +01:00
# Minification
The [mkdocs-minify-plugin][1] will minify all `*.html` files generated by
`mkdocs build` in a post-processing step, stripping all unnecessary characters
to reduce the payload served to the client.
2020-03-09 22:29:01 +01:00
!!! success "Bundled with the official Docker image"
This plugin is already installed for your convenience when you use the
official [Docker image][2], so the installation step can be skipped. Read
the [getting started guide][3] to get up and running with Docker.
2020-03-09 19:03:48 +01:00
[1]: https://github.com/byrnereese/mkdocs-minify-plugin
2020-03-09 22:29:01 +01:00
[2]: https://hub.docker.com/r/squidfunk/mkdocs-material/
[3]: ../getting-started.md#with-docker-recommended
2020-03-09 19:03:48 +01:00
## Installation
Install the plugin using `pip`:
``` sh
pip install mkdocs-minify-plugin
```
2020-03-09 22:29:01 +01:00
## Configuration
2020-03-09 19:03:48 +01:00
Add the following lines to `mkdocs.yml`:
``` yaml
plugins:
2020-03-09 22:29:01 +01:00
- search # necessary for search to work
2020-03-09 19:03:48 +01:00
- minify:
minify_html: true
```
2020-03-09 22:29:01 +01:00
## Usage
2020-03-09 19:03:48 +01:00
2020-03-09 22:29:01 +01:00
When enabled, all `*.html` will be minified automatically.