Configuring 11ty
While 11ty can be run without configuration, a little configuration will make our project cleaner and give us access to additional functionality within 11ty.
To configure 11ty, in our project root, we need a configuration file: eleventy.config.js
. At its core, 11ty is a Node.js project. The 11ty configuration file is a JavaScript file that exports a configuration function.
The basic structure of the file is as follows (not project code):
// Create variables that require() any packages we need const plugin = require('some-eleventy-plugin-package') // Use module.exports to export a configuration function module.exports = function(eleventyConfig) { // Run any code needed (including built-in 11ty methods) // If needed, return an object of configuration return { // Options here } }
By default, 11ty does not keep track of CSS files, basic JavaScript files, or image files....