Table of Contents
Plugin entrypoint
How to add Baseline to Eleventy, what it registers by default, the options you can pass, and the defaults it exports. For a code walkthrough of _baseline/eleventy.config.js, see Baseline config reference.
Baseline setup has two parts: in your Eleventy config file, first use the config callback to add the plugin, then export your config object using Baseline’s defaults. This page covers the first part.
This page focuses on adding the plugin and the options it exposes. For the exported config object (dirs, engines, formats), see Config object defaults.
Default usage
import baseline, { config as baselineConfig } from '@apleasantview/eleventy-plugin-baseline';
/** @param {import("@11ty/eleventy").UserConfig} eleventyConfig */
export default async function (eleventyConfig) {
eleventyConfig.addPlugin(baseline());
}
// Second configuration part.
export const config = baselineConfig;
Options
-
verbose (
false)
— emit extra logging from Baseline. -
enableNavigatorTemplate (
false)
— register the navigator template/routes; leave off unless you need the debug navigator. -
enableSitemapTemplate (
true)
— keep sitemap generation on by default; turn off if you manage sitemaps elsewhere. -
filterAllCollection (
true)
— overridecollections.allto filter out*.11tydata.jsitems added as a side-effect ofassets-esbuild; set tofalseif you manageallyourself. -
multilingual (
false)
— enable multilang core; requiresdefaultLanguageand alanguagesmap. -
defaultLanguage (
string)
— required whenmultilingualis true; set your default IETF code. -
languages (
object)
— required whenmultilingualis true; set your language map here. -
assetsESBuild (
{ minify: true, target: "es2020" })
— forwarded to assets-esbuild; settarget/minifyto match your browser support and environment.
What Baseline defaults add
-
HtmlBasePlugin
— Sets thebaseHrefoption to useprocess.env.URLorpathPrefix. -
Assets
— Registersassets-corefor the virtual "assets" directory used internally.
— Registersassets-postcssassets-esbuildmodules; setting up the assets pipeline for PostCSS (CSS) and esbuild (JS). -
Head
— Registershead-corehead management module; enabling the use of the PostHTML custom element<baseline-head>in templates. -
Sitemap
— Registerssitemap-coremodule with sitemap templates on by default. -
Navigator
— Registersnavigator-coremodule; enabling the use of the_navigator()and_context()debug globals./navigator-core.htmlvirtual template is off by default. -
Debug filters
— Handy_inspect,_json,_keysare available for use in templates. -
Filters
— Addsmarkdownify,relatedPosts,isStringfilters for use in templates (may be removed in a future release). -
Shortcode
image:
— For image processing witheleventy-img; usestransformOnRequestto process images only when requested during local development. -
Passthrough copy
— Copies./src/staticcontents to site root/(may be changed to./src/publicin a future release). -
Draft preprocessor
— Skips pages withdraft: trueset in the front matter duringELEVENTY_RUN_MODE=build.
Not included
- HTML image transform (
@11ty/eleventy-imgtransform) is not bundled; add it separately if you want content-level<img>rewrites. Baseline’s image shortcode is available either way.
Previous: Baseline plugin reference
Next: Config object defaults