@@ -9,7 +9,116 @@ further useful automatic optimization techniques.
99
1010## Configuration
1111
12- ### Built-in optimize plugin :material-alert-decagram:{ .mdx-pulse title="Added on January 21, 2023" }
12+ ### Built-in projects plugin :material-alert-decagram:{ .mdx-pulse title="Added on July 29, 2023" }
13+
14+ [ :octicons-heart-fill-24:{ .mdx-heart } Sponsors only] [ Insiders ] { .mdx-insiders } ·
15+ [ :octicons-tag-24: insiders-4.38.0] [ Insiders ] ·
16+ :octicons-cpu-24: Plugin ·
17+ :octicons-beaker-24: Experimental
18+
19+ The built-in projects plugin allows to split your documentation into multiple
20+ distinct MkDocs projects, __ build them concurrently__ and
21+ __ serve them together__ . Add the following to ` mkdocs.yml ` :
22+
23+ ``` yaml
24+ plugins :
25+ - projects
26+ ` ` `
27+
28+ Next, create a folder called ` projects` in your root directory which will
29+ contain all projects. For example, if we want to build a project with two
30+ additional languages, we can use :
31+
32+ ` ` ` { .sh .no-copy }
33+ .
34+ ├─ projects/
35+ │ ├─ de/
36+ │ │ ├─ docs/
37+ │ │ └─ mkdocs.yml
38+ │ └─ fr/
39+ │ ├─ docs/
40+ │ └─ mkdocs.yml
41+ └─ mkdocs.yml
42+ ` ` `
43+
44+ If you now invoke `mkdocs serve` and change a file in one of the projects,
45+ the projects plugin makes sure that MkDocs will also reload those files. Note
46+ that the projects are currently entirely separate, which means they will have
47+ separate search indexes and sitemaps. We're happy to receive feedback on this
48+ plugin and learn about your requirements to make it better, as we plan to add
49+ support for merging and hoisting files.
50+ [Create a discussion to share your thoughts!][discussion]
51+
52+ [discussion] : https://github.com/squidfunk/mkdocs-material/discussions
53+
54+ ??? info "Use cases for the projects plugin"
55+
56+ Ideal use cases for the projects plugin are :
57+
58+ - Building a multi-language site
59+ - Building a blog alongside your documentation
60+ - Splitting large code bases for better performance
61+
62+ Note that the plugin is currently experimental. We're releasing it early,
63+ so that we can improve it together with our users and make it even more
64+ powerful as we discover new use cases.
65+
66+ The following configuration options are available :
67+
68+ [`enabled`](#+projects.enabled){ # +projects.enabled }
69+
70+ : :octicons-milestone-24 : Default: `true` – This option specifies whether
71+ the plugin is enabled when building your project. If you want to speed up
72+ local builds, you can use an [environment variable] :
73+
74+ ` ` ` yaml
75+ plugins:
76+ - projects:
77+ enabled: !ENV [CI, false]
78+ ` ` `
79+
80+ [`concurrency`](#+projects.concurrency){ # +projects.concurrency }
81+
82+ : :octicons-milestone-24 : Default: _number of CPUs_ – This option specifies
83+ how many CPUs the plugin is allowed to use when building projects.
84+ With more CPUs, the plugin can do more work in the same time, thus complete
85+ optimization faster. Concurrent processing can be disabled with :
86+
87+ ` ` ` yaml
88+ plugins:
89+ - projects:
90+ concurrency: 1
91+ ` ` `
92+
93+ # ### Projects
94+
95+ The following configuration options are available for projects :
96+
97+ [`projects`](#+projects.projects){ # +projects.projects }
98+
99+ : :octicons-milestone-24 : Default: `true` – This option specifies whether
100+ to build nested projects. If you want to switch the plugin off, e.g.
101+ for local builds, you can use an [environment variable] :
102+
103+ ` ` ` yaml
104+ plugins:
105+ - projects:
106+ projects: !ENV [CI, false]
107+ ` ` `
108+
109+ [`projects_dir`](#+projects.projects_dir){ # +projects.projects_dir }
110+
111+ : :octicons-milestone-24 : Default: `projects` – This option specifies the
112+ name of the folder the plugin expects your projects to be stored. While it's
113+ usually not necessary to change this option, change it with :
114+
115+ ` ` ` yaml
116+ plugins:
117+ - projects:
118+ projects_dir: path/to/folder
119+ ` ` `
120+
121+ # ## Built-in optimize plugin
13122
14123[:octicons-heart-fill-24:{ .mdx-heart } Sponsors only][Insiders]{ .mdx-insiders } ·
15124[:octicons-tag-24 : insiders-4.29.0][Insiders] ·
0 commit comments