Created
April 17, 2024 17:40
-
-
Save pauleveritt/ae332543b07443abb765566ae74eb849 to your computer and use it in GitHub Desktop.
11ty constructor, options, dirs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test("should load an Eleventy site", async () => { | |
const elev = new Eleventy("./", "./_site", { | |
dir: { | |
includes: "my_includes", | |
layouts: "my_layouts", | |
}, | |
}); | |
await elev.init(); | |
const d = elev.config.dir; | |
expect(elev.config.dir.includes).toEqual("my_includes"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This pieces isn’t currently supported to set includes/layouts dirs:
Eleventy 3.0+
If you want to programmatically set custom includes/layouts directories without using a configuration file, the most straightforward way is to use the config API to do so.
directories
property here: 11ty/eleventy#3244Eleventy 2.0+
For previous versions of Eleventy it’s probably easiest to use
configPath
to point to an external configuration file:where
my-custom-config.js
contains: