@@ -4,7 +4,7 @@ template: overrides/main.html
4
4
5
5
# Ensuring data privacy
6
6
7
- Material for MkDocs makes compliance with data privacy regulations a breeze ,
7
+ Material for MkDocs makes compliance with data privacy regulations very easy ,
8
8
as it offers a native [ cookie consent] solution to seek explicit consent from
9
9
users before setting up [ tracking] . Additionally, external assets can be
10
10
automatically bundled as part of the build process.
@@ -21,36 +21,55 @@ automatically bundled as part of the build process.
21
21
:octicons-cpu-24: Plugin ·
22
22
:octicons-beaker-24: Experimental
23
23
24
- The built-in privacy plugin automatically downloads [ external assets] as part of
25
- the build process and stores them alongside your documentation. Add the
26
- following lines to ` mkdocs.yml ` :
27
-
24
+ The built-in privacy plugin automatically identifies [ external assets] as part
25
+ of the build process and allows to download and serve them as part of your site.
26
+ Add the following to ` mkdocs.yml ` :
28
27
29
28
``` yaml
30
29
plugins :
31
30
- privacy # (1)!
32
31
` ` `
33
32
34
33
1. Note that the privacy plugin should be located at the end of the list of
35
- ` plugins`, as it will scan the resulting HTML for links to download and
34
+ ` plugins`, as it will scan the resulting HTML for resources to download and
36
35
replace. If a plugin after the privacy plugin adds further
37
36
[external assets], these assets will not be downloaded.
38
37
39
38
The following configuration options are available :
40
39
41
- ` download ` { # download }
40
+ ` enabled ` { # enabled }
42
41
43
42
: :octicons-milestone-24 : Default: `true` – This option specifies whether
44
- the plugin should download [external assets]. If you want to switch the
45
- plugin off, e.g. for local builds, use an [environment variable] :
43
+ the plugin is enabled when building your project. If you want to switch
44
+ the plugin off, e.g. for local builds, use an [environment variable] :
45
+
46
+ ` ` ` yaml
47
+ plugins:
48
+ - privacy:
49
+ enabled: !ENV [PRIVACY, false]
50
+ ` ` `
51
+
52
+ ` externals` { # externals }
53
+
54
+ : :octicons-milestone-24 : Default: `bundle` – This option specifies what the
55
+ plugin should do when encountering external assets. There are two options :
56
+ while `report` will issue a warning message during the build, `bundle` will
57
+ automatically download all external files and adjust all references :
46
58
47
59
` ` ` yaml
48
60
plugins:
49
61
- privacy:
50
- download: !ENV [DOWNLOAD, false]
62
+ externals: bundle
51
63
` ` `
52
64
53
- ` download_directory` { # download-directory }
65
+ If you've removed all external assets from your project via [customization],
66
+ it's still a good idea to enable the plugin and set the mode to `report`,
67
+ as the plugin will make sure that there are no hidden external links in any
68
+ Markdown files that were unintentionally added to the build.
69
+
70
+ [customization] : ../customization.md
71
+
72
+ ` externals_directory` { # externals-directory }
54
73
55
74
: :octicons-milestone-24 : Default: `assets/externals` – This option
56
75
specifies where the downloaded [external assets] will be stored. It's
@@ -59,7 +78,7 @@ The following configuration options are available:
59
78
` ` ` yaml
60
79
plugins:
61
80
- privacy:
62
- download_directory : assets/externals
81
+ externals_directory : assets/externals
63
82
` ` `
64
83
65
84
[external assets] : # how-it-works
@@ -72,7 +91,7 @@ The following configuration options are available:
72
91
different fonts that can be used to render your documentation. Most of the
73
92
fonts include several weights and are split up into different character sets
74
93
to keep the download size small, so the browser only downloads what is
75
- really needed. For Roboto, our default [regular font], this results in [28
94
+ really needed. For Roboto, our default [regular font], this results in [42
76
95
` *.woff2` files in total][example].
77
96
78
97
If Material for MkDocs would bundle all font files, the download size would
@@ -117,7 +136,7 @@ As a third measure, [`preconnect`][preconnect] hints used for DNS pre-fetching
117
136
which might also leak the visitors IP address to a third party are automatically
118
137
removed during the build process.
119
138
120
- ???+ example "Expand to inspect example"
139
+ ??? example "Expand to inspect example"
121
140
122
141
For the official documentation, the [built-in privacy] plugin downloads the
123
142
following resources :
@@ -129,41 +148,61 @@ removed during the build process.
129
148
├─ fonts.googleapis.com/css
130
149
├─ fonts.gstatic.com/s/
131
150
│ ├─ roboto/v29/
132
- │ │ ├─ KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2
133
- │ │ ├─ KFOmCnqEu92Fr1Mu7mxKOzY.woff2
134
- │ │ ├─ KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2
135
- │ │ ├─ KFOmCnqEu92Fr1Mu4mxK.woff2
151
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TjASc-CsTKlA.woff2
152
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TjASc0CsTKlA.woff2
153
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TjASc1CsTKlA.woff2
154
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TjASc2CsTKlA.woff2
155
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TjASc3CsTKlA.woff2
156
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TjASc5CsTKlA.woff2
157
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TjASc6CsQ.woff2
158
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TzBic-CsTKlA.woff2
159
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TzBic0CsTKlA.woff2
160
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TzBic1CsTKlA.woff2
161
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TzBic2CsTKlA.woff2
162
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TzBic3CsTKlA.woff2
163
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TzBic5CsTKlA.woff2
164
+ │ │ ├─ KFOjCnqEu92Fr1Mu51TzBic6CsQ.woff2
136
165
│ │ ├─ KFOkCnqEu92Fr1Mu51xEIzIFKw.woff2
137
- │ │ ├─ KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2
166
+ │ │ ├─ KFOkCnqEu92Fr1Mu51xFIzIFKw.woff2
167
+ │ │ ├─ KFOkCnqEu92Fr1Mu51xGIzIFKw.woff2
168
+ │ │ ├─ KFOkCnqEu92Fr1Mu51xHIzIFKw.woff2
169
+ │ │ ├─ KFOkCnqEu92Fr1Mu51xIIzI.woff2
138
170
│ │ ├─ KFOkCnqEu92Fr1Mu51xLIzIFKw.woff2
171
+ │ │ ├─ KFOkCnqEu92Fr1Mu51xMIzIFKw.woff2
172
+ │ │ ├─ KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2
173
+ │ │ ├─ KFOlCnqEu92Fr1MmSU5fBBc4.woff2
174
+ │ │ ├─ KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2
175
+ │ │ ├─ KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2
176
+ │ │ ├─ KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2
177
+ │ │ ├─ KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2
178
+ │ │ ├─ KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2
179
+ │ │ ├─ KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2
139
180
│ │ ├─ KFOlCnqEu92Fr1MmWUlfBBc4.woff2
140
181
│ │ ├─ KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2
141
- │ │ ├─ KFOkCnqEu92Fr1Mu51xFIzIFKw.woff2
142
- │ │ ├─ KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2
143
182
│ │ ├─ KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2
144
- │ │ ├─ KFOmCnqEu92Fr1Mu7GxKOzY.woff2
145
- │ │ ├─ KFOkCnqEu92Fr1Mu51xMIzIFKw.woff2
146
- │ │ ├─ KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2
147
183
│ │ ├─ KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2
148
- │ │ ├─ KFOmCnqEu92Fr1Mu7WxKOzY.woff2
149
- │ │ ├─ KFOmCnqEu92Fr1Mu72xKOzY.woff2
150
- │ │ ├─ KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2
151
- │ │ ├─ KFOkCnqEu92Fr1Mu51xHIzIFKw.woff2
152
- │ │ ├─ KFOmCnqEu92Fr1Mu5mxKOzY.woff2
153
- │ │ ├─ KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2
154
- │ │ ├─ KFOkCnqEu92Fr1Mu51xIIzI.woff2
155
- │ │ ├─ KFOmCnqEu92Fr1Mu4WxKOzY.woff2
156
- │ │ ├─ KFOkCnqEu92Fr1Mu51xGIzIFKw.woff2
184
+ │ │ ├─ KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2
157
185
│ │ ├─ KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2
158
- │ │ ├─ KFOlCnqEu92Fr1MmSU5fBBc4.woff2
159
- │ │ └─ KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2
186
+ │ │ ├─ KFOmCnqEu92Fr1Mu4WxKOzY.woff2
187
+ │ │ ├─ KFOmCnqEu92Fr1Mu4mxK.woff2
188
+ │ │ ├─ KFOmCnqEu92Fr1Mu5mxKOzY.woff2
189
+ │ │ ├─ KFOmCnqEu92Fr1Mu72xKOzY.woff2
190
+ │ │ ├─ KFOmCnqEu92Fr1Mu7GxKOzY.woff2
191
+ │ │ ├─ KFOmCnqEu92Fr1Mu7WxKOzY.woff2
192
+ │ │ └─ KFOmCnqEu92Fr1Mu7mxKOzY.woff2
160
193
│ └─ robotomono/v13/
161
- │ ├─ L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_R-W4Ep0.woff2
162
- │ ├─ L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_QOW4Ep0.woff2
163
- │ ├─ L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_SuW4Ep0.woff2
164
- │ ├─ L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_ROW4.woff2
165
- │ ├─ L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_SeW4Ep0.woff2
166
- │ └─ L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_S-W4Ep0.woff2
194
+ │ ├─ L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0mf0h.woff2
195
+ │ ├─ L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0mf0h.woff2
196
+ │ ├─ L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0mf0h.woff2
197
+ │ ├─ L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0mQ.woff2
198
+ │ ├─ L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0mf0h.woff2
199
+ │ ├─ L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0mf0h.woff2
200
+ │ ├─ L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlYIw.woff2
201
+ │ ├─ L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlYIw.woff2
202
+ │ ├─ L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlYIw.woff2
203
+ │ ├─ L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ul.woff2
204
+ │ ├─ L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlYIw.woff2
205
+ │ └─ L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-UlYIw.woff2
167
206
└─ polyfill.io/v3/polyfill.min.js
168
207
` ` `
169
208
@@ -210,6 +249,20 @@ carried out. You might want to:
210
249
211
250
Note that dynamically created URLs as part of scripts are not detected, and thus
212
251
cannot be automatically downloaded. The [built-in privacy] plugin does not
213
- execute scripts – it can only detect complete URLs to download and replace.
252
+ execute scripts – it can only detect fully qualified URLs to download and
253
+ replace.
254
+
255
+ In short, don't do this :
256
+
257
+ ` ` ` js
258
+ const cdn = "https://polyfill.io"
259
+ const url = ` ${cdn}/v3/polyfill.min.js`
260
+ ```
261
+
262
+ Instead, always use fully qualified URLs:
263
+
264
+ ``` js
265
+ const url = " https://polyfill.io/v3/polyfill.min.js"
266
+ ```
214
267
215
268
[ Insiders ] : ../insiders/index.md
0 commit comments