-
-
Save zachleat/5b5ae0ddadbeba6169f18e5b4aa58a66 to your computer and use it in GitHub Desktop.
Using Eleventy Programmatically
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
const Eleventy = require("@11ty/eleventy"); | |
(async function() { | |
let inst = new Eleventy(); | |
await inst.init(); | |
await inst.write(); | |
})(); |
I’m don’t remember the context of this gist but 11ty/eleventy#1629 (comment) might be a better bet. Couple of things:
- this isn’t an officially supported use case yet.
- That said, I think the only thing about the original that I would consider off is the instantiation.
new Eleventy(input, output);
are required
Thanks. This does work:
const Eleventy = require("@11ty/eleventy");
(async function() {
let inst = new Eleventy(".", "./_site");
await inst.init();
await inst.write();
})();
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just ran this verbatim and
inst.init()
just hung.