2023-01-21 17:03:55 +01:00
|
|
|
|
# Building an optimized site
|
|
|
|
|
|
|
|
|
|
Material for MkDocs, by default, allows to build optimized sites that rank great
|
|
|
|
|
on search engines, load fast (even on slow networks), and work perfectly without
|
|
|
|
|
JavaScript. Additionally, the [built-in optimize plugin] adds support for
|
|
|
|
|
further useful automatic optimization techniques.
|
|
|
|
|
|
|
|
|
|
[built-in optimize plugin]: #built-in-optimize-plugin
|
|
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
2023-07-29 17:24:22 +02:00
|
|
|
|
### Built-in projects plugin :material-alert-decagram:{ .mdx-pulse title="Added on July 29, 2023" }
|
|
|
|
|
|
2023-09-14 19:09:18 +02:00
|
|
|
|
<!-- md:sponsors -->
|
|
|
|
|
<!-- md:version insiders-4.38.0 -->
|
|
|
|
|
<!-- md:plugin [projects] – built-in -->
|
|
|
|
|
<!-- md:flag experimental -->
|
2023-07-29 17:24:22 +02:00
|
|
|
|
|
|
|
|
|
The built-in projects plugin allows to split your documentation into multiple
|
|
|
|
|
distinct MkDocs projects, __build them concurrently__ and
|
|
|
|
|
__serve them together__. Add the following to `mkdocs.yml`:
|
|
|
|
|
|
|
|
|
|
``` yaml
|
|
|
|
|
plugins:
|
|
|
|
|
- projects
|
|
|
|
|
```
|
|
|
|
|
|
2023-09-14 19:09:18 +02:00
|
|
|
|
For a list of all settings, please consult the [plugin documentation].
|
2023-07-29 17:24:22 +02:00
|
|
|
|
|
2023-09-14 19:09:18 +02:00
|
|
|
|
[projects]: ../plugins/projects.md
|
|
|
|
|
[plugin documentation]: ../plugins/projects.md
|
2023-07-29 17:24:22 +02:00
|
|
|
|
|
|
|
|
|
??? info "Use cases for the projects plugin"
|
|
|
|
|
|
|
|
|
|
Ideal use cases for the projects plugin are:
|
|
|
|
|
|
|
|
|
|
- Building a multi-language site
|
|
|
|
|
- Building a blog alongside your documentation
|
|
|
|
|
- Splitting large code bases for better performance
|
|
|
|
|
|
|
|
|
|
Note that the plugin is currently experimental. We're releasing it early,
|
|
|
|
|
so that we can improve it together with our users and make it even more
|
|
|
|
|
powerful as we discover new use cases.
|
|
|
|
|
|
|
|
|
|
### Built-in optimize plugin
|
2023-01-21 17:03:55 +01:00
|
|
|
|
|
2023-09-14 19:09:18 +02:00
|
|
|
|
<!-- md:sponsors -->
|
|
|
|
|
<!-- md:version insiders-4.29.0 -->
|
|
|
|
|
<!-- md:plugin [optimize] – built-in -->
|
|
|
|
|
<!-- md:flag experimental -->
|
2023-01-21 17:03:55 +01:00
|
|
|
|
|
|
|
|
|
The built-in optimize plugin automatically identifies and optimizes all media
|
|
|
|
|
files as part of the build using compression and conversion techniques. Add
|
|
|
|
|
the following lines to `mkdocs.yml`:
|
|
|
|
|
|
|
|
|
|
``` yaml
|
|
|
|
|
plugins:
|
2023-01-21 17:51:17 +01:00
|
|
|
|
- optimize # (1)!
|
2023-01-21 17:03:55 +01:00
|
|
|
|
```
|
|
|
|
|
|
2023-09-14 19:09:18 +02:00
|
|
|
|
For a list of all settings, please consult the [plugin documentation][optimize].
|
2023-01-21 17:03:55 +01:00
|
|
|
|
|
2023-09-14 19:09:18 +02:00
|
|
|
|
[optimize]: ../plugins/optimize.md
|