You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,13 +27,22 @@ Enable the plugin in your `mkdocs.yml`:
27
27
```yaml
28
28
plugins:
29
29
- search
30
-
- markdownextradata
30
+
- markdownextradata:
31
+
data: path/to/datafiles
31
32
```
32
33
33
34
> **Note:** 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, but now you have to enable it explicitly.
34
35
35
36
More information about plugins in the [MkDocs documentation][mkdocs-plugins]
36
37
38
+
The data path is optional; when absent, it will look for a `_data`
39
+
folder adjacent to your `mkdocs.yml` and inside your `docs_dir`.
40
+
If this path is found, the plugin will read all `.yml` and `.json`
41
+
files inside it and add the data in them to the data available to the templates.
42
+
The paths to these become their variable names, so if inside your data folder you have a file
43
+
called `sections/captions.yml`, the data inside that file will be available in your
# this loads all data from the supplied data directory, or otherwise a _data directory next to mkdocs.yml or inside the docs_dir. Does nothing if the dir does not exist.
0 commit comments