new Eleventy(input, output)
Parameters:
Name | Type | Description |
---|---|---|
input |
String | Where to read files from. |
output |
String | Where to write rendered files to. |
Returns:
Members
-
config :Object
-
Initialize Eleventy’s configuration, including the user config file
Type:
- Object
-
configPath :String
-
The path to Eleventy's config file.
Type:
- String
- Default Value:
-
- null
-
eleventyServe :Object
-
tbd.
Type:
- Object
-
env :Object
-
Initialize Eleventy environment variables
Type:
- Object
- Default Value:
-
- null
-
formatsOverride :Array.<String>
-
Subset of template types.
Type:
- Array.<String>
- Default Value:
-
- null
-
input :String
-
Type:
- String
-
inputDir :String
-
Type:
- String
-
isDryRun :Boolean
-
Is Eleventy running in dry mode?
Type:
- Boolean
- Default Value:
-
- false
-
outputDir :String
-
Type:
- String
-
rawInput :String
-
Holds the path to the input directory.
Type:
- String
-
rawOutput :String
-
Holds the path to the output directory.
Type:
- String
-
start :Number
-
The timestamp of Eleventy start.
Type:
- Number
-
verboseModeSetViaCommandLineParam :Boolean
-
Was verbose mode overwritten?
Type:
- Boolean
- Default Value:
-
- false
-
watcherBench
-
tbd.
-
watchManager :Object
-
tbd.
Type:
- Object
-
watchTargets :Object
-
tbd.
Type:
- Object
Methods
-
<async, private> _addFileToWatchQueue(changedFilePath)
-
tbd.
Parameters:
Name Type Description changedFilePath
String File that triggered a re-run (added or modified)
-
<async, private> _initWatchDependencies()
-
Starts watching dependencies.
-
<async, private> _watch()
-
tbd.
-
<async> executeBuild()
-
tbd.
Returns:
ret - tbd.
- Type
- Promise.<{}>
-
getHelp()
-
Shows a help message including usage.
Returns:
- The help mesage.
- Type
- String
-
getVersion()
-
Reads the version of Eleventy.
Returns:
- The version of Eleventy.
- Type
- String
-
<async> getWatchedFiles()
-
Returns all watched files.
Returns:
targets - The watched files.
-
<async> init()
-
Starts Eleventy.
Returns:
- tbd.
-
initializeEnvironmentVariables()
-
Set process.ENV variables for use in Eleventy projects
-
<async> initWatch()
-
Set up watchers and benchmarks.
-
logFinished()
-
Logs some statistics after a complete run of Eleventy.
Returns:
ret - The log message.
- Type
- String
-
resetConfig()
-
Resets the config of Eleventy.
-
<async> restart()
-
Restarts Eleventy.
-
serve(port)
-
Serve Eleventy on this port.
Parameters:
Name Type Description port
Number The HTTP port to serve Eleventy from.
-
setDryRun(isDryRun)
-
Updates the dry-run mode of Eleventy.
Parameters:
Name Type Description isDryRun
Boolean Shall Eleventy run in dry mode?
-
setFormats(formats)
-
Updates the template formats of Eleventy.
Parameters:
Name Type Description formats
String The new template formats.
-
setIncrementalBuild(isIncremental)
-
Sets the incremental build mode.
Parameters:
Name Type Description isIncremental
Boolean Shall Eleventy run in incremental build mode and only write the files that trigger watch updates
-
setIsVerbose(isVerbose)
-
Updates the verbose mode of Eleventy.
Parameters:
Name Type Description isVerbose
Boolean Shall Eleventy run in verbose mode?
-
setPassthroughAll(isPassthroughAll)
-
Updates the passthrough mode of Eleventy.
Parameters:
Name Type Description isPassthroughAll
Boolean Shall Eleventy passthrough everything?
-
setPathPrefix(pathPrefix)
-
Updates the path prefix used in the config.
Parameters:
Name Type Description pathPrefix
String The new path prefix.
-
setWatchTargets(watchTargets)
-
Updates the watch targets.
Parameters:
Name Type Description watchTargets
The new watch targets.
-
<async> toJSON()
-
Renders templates to a JSON object.
Returns:
- Type
- Promise.<{}>
-
<async> toNDJSON()
-
Returns a stream of new line delimited (NDJSON) objects
Returns:
- Type
- Promise.<{ReadableStream}>
-
<async> watch()
-
Start the watching of files.
-
<async> write()
-
Writes templates to the file system.
Returns:
- Type
- Promise.<{}>