Skip to content

Commit 7d278b6

Browse files
committed
Merge branch 'develop'
2 parents a9d8815 + 8d7cbb1 commit 7d278b6

File tree

4 files changed

+317
-170
lines changed

4 files changed

+317
-170
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ With Xray you can, for example, quickly debug your pagination. Or confirm that y
1616
- [Build information](#build-information)
1717
- [Page data](#page-data)
1818
- [Global data](#global-data)
19+
- [Modes of operation](#modes-of-operation)
20+
- [serve](#serve)
21+
- [build](#build)
22+
- [auto](#auto)
1923
- [Performance](#performance)
2024
- [License](#license)
2125

@@ -56,6 +60,7 @@ List of available options:
5660

5761
|Name | Description | Type of value | Default |
5862
| -- | -- | -- | -- |
63+
| `mode` | The mode in which Xray will operate ('serve', 'build', 'auto'). See [modes of operation](#modes-of-operation). | `String` | 'auto' |
5964
| `dir` | The directory in which Xray writes its assets and data files. Relative to `eleventyConfig.dir.output`. | `String` | '_xray' |
6065
| `benchmarks` | Should benchmark data be parsed and displayed? | `Boolean` | `true` |
6166
| `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
9095

9196
You can navigate the branches here as well.
9297

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+
93111
## Performance
94112
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.
95113

0 commit comments

Comments
 (0)