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
+48-20Lines changed: 48 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,33 +35,19 @@ You are then able to use the mkdocs `extra: {}` hash to pass context data into y
35
35
> **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.
36
36
37
37
38
-
### Using external data files
39
-
40
-
If the `extra: {}` hash is not enough for your data then you are able to make use of external yaml files to provide that context data
41
-
42
-
```yaml
43
-
plugins:
44
-
- search
45
-
- markdownextradata:
46
-
data: path/to/datafiles
47
-
```
48
-
49
-
The data path is optional; when absent, it will look for a `_data`
50
-
folder adjacent to your `mkdocs.yml` and inside your `docs_dir`.
51
-
If this path is found, the plugin will read all `.yml` and `.json`
52
-
files inside it and add the data in them to the data available to the templates.
53
-
The paths to these become their variable names, so if inside your data folder you have a file
54
-
called `sections/captions.yml`, the data inside that file will be available in your
55
-
templates as `sections.captions`.
56
-
57
-
58
38
## Features
59
39
60
40
### Use Extra Variables in your markdown files
61
41
62
42
The variables you define in the mkdown.yml `extra:` slot will become available in your templates
# 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.
41
+
# Loads all data from the supplied data directories
42
+
# or, otherwise a _data directory next to mkdocs.yml and/or inside the docs_dir.
0 commit comments