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
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,10 @@ With Xray you can, for example, quickly debug your pagination. Or confirm that y
16
16
-[Build information](#build-information)
17
17
-[Page data](#page-data)
18
18
-[Global data](#global-data)
19
+
-[Modes of operation](#modes-of-operation)
20
+
-[serve](#serve)
21
+
-[build](#build)
22
+
-[auto](#auto)
19
23
-[Performance](#performance)
20
24
-[License](#license)
21
25
@@ -56,6 +60,7 @@ List of available options:
56
60
57
61
|Name | Description | Type of value | Default |
58
62
| -- | -- | -- | -- |
63
+
|`mode`| The mode in which Xray will operate ('serve', 'build', 'auto'). See [modes of operation](#modes-of-operation). |`String`| 'auto' |
59
64
|`dir`| The directory in which Xray writes its assets and data files. Relative to `eleventyConfig.dir.output`. |`String`| '_xray' |
60
65
|`benchmarks`| Should benchmark data be parsed and displayed? |`Boolean`|`true`|
61
66
|`git`| Should Git info of `eleventyConfig.dir.input` be displayed? |`Boolean`|`true`|
@@ -90,6 +95,19 @@ The available global data. For the sake of clarity, this is displayed separately
90
95
91
96
You can navigate the branches here as well.
92
97
98
+
## Modes of operation
99
+
Through the option `mode`, three modes of operation can be configured: `serve`, `build` and `auto`.
100
+
101
+
### serve
102
+
If Eleventy runs in `serve` mode as well, all Xray files will be served virtually through the [Eleventy Dev Server](https://www.11ty.dev/docs/dev-server/). No files will be written to disk. Virtual files will have precedence over static files e.g. from a previous run in `build` mode.
103
+
If Eleventy runs in another mode, Xray is deactivated.
104
+
105
+
### build
106
+
All Xray files will be written to disk and served as static files. Xray uses relative paths to load these static files, so Xray even works when opening a rendered HTML page in the browser without the Eleventy Dev Server.
107
+
108
+
### auto
109
+
Synchronizes Xray's mode with Eleventy's run mode.
110
+
93
111
## Performance
94
112
Since Xray recursively parses the complete data hierarchy of _every_ page it has been added to, it can _significantly_ extend Eleventy's build times. If you build a website with hundreds of pages and/or hundreds of data sets, consider reducing `maxDepth` to a minimum and adding the shortcode only to the page(s) you are currently working on.
0 commit comments