mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-28 09:20:52 +01:00
33 lines
774 B
Markdown
33 lines
774 B
Markdown
# 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.
|
|
|
|
[1]: https://github.com/byrnereese/mkdocs-minify-plugin
|
|
|
|
## Installation
|
|
|
|
Install the plugin using `pip`:
|
|
|
|
``` sh
|
|
pip install mkdocs-minify-plugin
|
|
```
|
|
|
|
## Usage
|
|
|
|
Add the following lines to `mkdocs.yml`:
|
|
|
|
``` yaml
|
|
plugins:
|
|
- search
|
|
- minify:
|
|
minify_html: true
|
|
```
|
|
|
|
!!! warning "Remember to re-add the `search` plugin"
|
|
|
|
If you have no `plugins` entry in your config file yet, you'll likely also
|
|
want to add back the `search` plugin. MkDocs enables it by default if there
|
|
is no `plugins` entry set and it will not be included if omitted.
|