---
title: 'Plugin entrypoint'
description: 'The baseline() factory: signature, options, and what it registers when you add it to Eleventy.'
slug: 'plugin-entrypoint'
type: 'article'
date: 2026-04-15T00:00:00.000Z
lang: 'en'
url: 'https://www.eleventy-baseline.dev/docs/core-reference/plugin-entrypoint/'
---

The `baseline()` factory is the single entry point. You call it once in your Eleventy config callback with two arguments: site `settings` and module `options`. Everything below is what that call sets up.

For the directory contract Baseline ships alongside the factory, see [[config-export | Config export]]. For the `settings` argument, see [[site-settings | Site settings]]. This page covers the second argument, `options`, which controls module activation and behaviour.

---

## Default usage

```js
import baseline, { config as baselineConfig } from '@apleasantview/eleventy-plugin-baseline';
import settings from './src/_data/settings.js';

/** @param {import("@11ty/eleventy").UserConfig} eleventyConfig */
export default async function (eleventyConfig) {
	await eleventyConfig.addPlugin(baseline(settings));
}

export const config = baselineConfig;
```

`baseline()` itself is synchronous, but it returns an async closure (Eleventy's documented async-plugin pattern). The `await` on `addPlugin` is the correct shape.

---

## Options

```js
await eleventyConfig.addPlugin(
	baseline(settings, {
		verbose: true,
		multilingual: false,
		sitemap: true,
		navigator: true,
		head: { titleSeparator: ' – ', showGenerator: false },
		assets: { esbuild: {} }
	})
);
```

{% stepsBlock "compact" %}

- **verbose** (`true`)  
  Emit Baseline's build narrative: the boxed startup banner, a "Baseline vX, running Eleventy vY" line, and `info`-level lines from the plugin and its modules. `warn` and `error` always emit regardless. Set to `false` for a silent build.

- **multilingual** (`false`)  
  Turn on the multilang module. Activation is explicit: all three of `options.multilingual: true`, `settings.defaultLanguage`, and a non-empty `settings.languages` are required. Nothing is inferred.

- **sitemap** (`true`)  
  Generate XML sitemaps. Set to `false` if you produce sitemaps elsewhere.

- **navigator** (`true` in development, `false` otherwise)  
  Register debug globals and the optional `/navigator-core.html` introspection template. Boolean toggles both. Object form `{ template, inspectorDepth }` tunes them independently: `template` (boolean) controls whether the page renders, `inspectorDepth` (integer, default `4`) sets how deep the `_inspect` filter walks. See the [[navigator | navigator module]] for the surface.

- **head.titleSeparator** (`' – '`)  
  String placed between the page title and the site title in `<title>`.

- **head.titleTemplate** (none)  
  Template for the whole `<title>`, with tokens `%s` (page title), `%siteTitle%`, and `%tagline%`. Overrides the separator composition. A page can also set its own `titleTemplate` in front matter, or `null` for a bare title.

- **head.showGenerator** (`false`)  
  Emit a `<meta name="generator">` tag in the head.

- **assets.esbuild** (`{}`)  
  An options bag forwarded to esbuild. See the [esbuild documentation](https://esbuild.github.io/api/) for keys.

{% endstepsBlock %}

---

## What Baseline registers

In the order the entry point runs:

{% stepsBlock "compact" %}

- **Reserved data keys** - twelve reserved keys initialised to `{}` so module-namespaced data can merge cleanly. See [[globals | Globals]].
- **`_baseline` top-level + `env`** - `name` and `version` at the top level; `env` carries `mode` (read from `process.env.ELEVENTY_ENV`) and `package` (npm package name). Mirrors the shape of Eleventy's own `eleventy` global.
- **`_baseline.options`** - snapshot of the resolved `options` object (`state.options`).
- **Date global** - a `date` function exposed to templates.
- **HtmlBasePlugin** - sets `baseHref` from `process.env.URL` or `pathPrefix`.
- **`_baseline.features`** - flags reflecting the resolved options.
- **Virtual directories** - synthesises the `assets` and `public` keys on `eleventyConfig.directories`. See [[config-export | Config export]] for the asymmetry with the on-disk `static/` folder.
- **Passthrough copy** - mounts the `public` virtual directory at the site root `/`.
- **`_baseline.paths`** - resolved input, output, includes, data, assets, and public directories.
- **Drafts preprocessor** - skips pages with `draft: true` when `ELEVENTY_RUN_MODE === 'build'`. Guarded: if you have already registered a `drafts` preprocessor, Baseline leaves it alone.
- **Runtime stores** - content-map and translation-map stores; used by the page-context registry and the head module.
- **Page-context registry** - per-page object built at cascade-time, exposed as `_pageContext`. See [[page-context | Page context]].
- **Modules** - registered in order: `multilang` (when active), `sitemap` (when active), `navigator` (when active), `head`, `assets`. The last two are unconditional.
- **Filters** - `markdownify`, `relatedPosts`, `isString`. Module-specific filters are documented on [[filters | Filters]].
- **Shortcode: `image`** - responsive `<picture>` via `@11ty/eleventy-img`. See [[image-shortcode | Image shortcode]].
- **Image dev server** - on-demand image generation during `--serve`.
- **Markdown substrate** - three plugins applied through `amendLibrary('md', ...)`, each guarded by a `safeUse` helper that skips re-registering plugins a user already loaded: `markdown-it-attrs` (for {% raw %}`{#id .class}`{% endraw %} syntax on any element), an auto-heading-ids plugin (assigns stable `id` attrs with WordPress-style dedup; manual ids win), and the `wikilinks` plugin (`[[slug]]` / `[[slug:lang]]` / `[[slug|alias]]` / `[[slug#anchor]]` resolution). See [[content-helpers | Content helpers]] for the author-facing syntax.
- **Content-graph pre-pass** - sentinel-guarded inner build that runs on every `eleventy.before` event, walks every rendered page, writes `.cache/_baseline/content-graph.json`, and hooks the result into the cascade as `eleventyComputed._node` (the page's own graph node), `eleventyComputed._backlinks` (edges where `to === page.url`, as bare edge records), and `eleventyComputed._outgoing` (edges where `from === page.url`, same shape). The site-wide view is on the navigator's `_navigator` global (`{ nodes, edges, backlinks }`).

{% endstepsBlock %}

The `head` module's render strategy is selected by a code-level driver seam, not a user option. One driver ships today. See [[internals | Internals]].

---

## Plugin metadata

`baseline()` returns a function whose `name` property is set to `@apleasantview/eleventy-plugin-baseline`, so `eleventyConfig.hasPlugin('@apleasantview/eleventy-plugin-baseline')` returns `true` once the plugin is added.

## Not included

`@11ty/eleventy-img`'s HTML transform (`eleventyImageTransformPlugin`) is not bundled. Add it yourself if you want content-level `<img>` rewrites. The image shortcode works either way; the difference is whether `<img>` tags written into Markdown also get transformed.

---

## See also

- [[site-settings | Site settings]] - the `settings` argument.
- [[config-export | Config export]] - the directory contract.
- [[globals | Globals]] - `_baseline`, `_pageContext`, `_snapshot`, and the reserved keys.
- [[page-context | Page context]] - what the registry exposes.
- [[internals | Internals]] - registry, stores, virtual dirs, driver seam.
