From bc46b87d6a441d8df60b52583547f6b20cbf9729 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sat, 15 Jun 2019 15:47:53 +0200 Subject: [PATCH] Added documentation on minification --- CHANGELOG | 3 ++- docs/getting-started.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d2b712316..5f9b62384 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ -mkdocs-material-4.x.x (2019-06-15) +mkdocs-material-4.4.0 (2019-06-15) * Added Slovenian translations + * Reverted template minification in favor of mkdocs-minify-plugin mkdocs-material-4.3.1 (2019-05-23) diff --git a/docs/getting-started.md b/docs/getting-started.md index 52a74bed2..d3b93d69b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -682,6 +682,40 @@ Material theme including more information regarding installation and usage: [30]: extensions/permalinks.md [31]: extensions/pymdown.md +## Plugins + +MkDocs's plugin architecture makes it possible to add pre- or post-processing +steps that sit between the theme and your documentation. A great example of a +third-party plugin is the [mkdocs-minify-plugin][32] which strips all whitespace +from the generated documentation. + +Install it with `pip`: + +``` sh +pip install mkdocs-minify-plugin +``` + +Enable it with the following lines in your `mkdocs.yml`: + +``` yaml +plugins: + - search + - minify: + minify_html: true + minify_js: true +``` + +The MkDocs wiki contains a [list of all available plugins][33]. + +!!! 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 the `search` plugin. MkDocs enables it by default if there is + no `plugins` entry set. + + [32]: https://github.com/byrnereese/mkdocs-minify-plugin + [33]: https://github.com/mkdocs/mkdocs/wiki/MkDocs-Plugins + ## Full example Below is a full example configuration for a `mkdocs.yml`: