Table of Contents
Page 4 of 6

Eleventy Base Blog

Park the old config and write a minimal one

Move eleventy.config.js out of the way, then write a new one from scratch:

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

export default async function (eleventyConfig) {
	await eleventyConfig.addPlugin(baseline(settings));
}

export const config = baselineConfig;

Nine lines. Not a diff, and not the old file with most of it commented out. The parked copy is your reference; a live config full of dead code is harder to read than the file next to it.

This is the step the rest of the guide is arranged around. Patching the old config in place is what let the previous version of this guide rot: advice about retargeting addBundle survived for months after the assets module made it wrong, because nobody was made to justify each registration.

export const config = baselineConfig replaces the starter's templateFormats as well. Baseline's ['html', 'njk', 'md'] drops liquid and 11ty.js, which nothing in the starter uses. Keep njk: several of Baseline's virtual templates are Nunjucks.

Run the build and fix what it names

npm start

The build is the checklist. Eleventy reports config-level failures before it renders anything, so missing plugins surface first and missing filters and shortcodes second, which is a usable teaching order that falls out for free.

Two deletions first:

  1. Delete src/content/sitemap.xml.njk. The sitemap module owns that now.
  2. Delete the per-page bundle markup in base.njk and post.njk, along with both addBundle calls. The assets module owns dist/assets/, and two things writing there is one too many. Step 12 rehomes what the bundles carried.

Then what comes back, in the order it sits in the finished file:

  1. The drafts preprocessor, if you want it. A choice rather than a fix, see below.
  2. _config/filters.js. readableDate, htmlDateString, filterTagList, sortAlphabetically, getKeys and min are all still load-bearing in templates. Overlap with Baseline's own filters is not a reason to drop them.
  3. The currentBuildDate shortcode.
  4. @11ty/eleventy-navigation.

The build will name them in its own order rather than this one, since it reports config-level failures before template-level ones. Adding them in file order keeps the config readable as it grows, and nothing here depends on registration order.

The whole file at the end of this step, so you can check yours against it:

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

import pluginFilters from './_config/filters.js';
import pluginNavigation from '@11ty/eleventy-navigation';

export default async function (eleventyConfig) {
	await eleventyConfig.addPlugin(baseline(settings));

	// Drafts, see also _data/eleventyDataSchema.js
	eleventyConfig.addPreprocessor('drafts', '*', (data, content) => {
		if (data.draft) {
			data.title = `${data.title} (draft)`;
		}

		if (data.draft && process.env.ELEVENTY_RUN_MODE === 'build') {
			return false;
		}
	});

	eleventyConfig.addPlugin(pluginFilters);

	eleventyConfig.addShortcode('currentBuildDate', () => {
		return new Date().toISOString();
	});

	eleventyConfig.addPlugin(pluginNavigation);
}

export const config = baselineConfig;

Twenty-two lines against the original's 168, and that is the low-water mark rather than the finished state. The feed, syntax highlighting and the image transform come back on the next page, taking it to 84.

On drafts. Baseline registers its own drafts preprocessor and guards the registration, and Eleventy keys preprocessors by name, so yours wins whichever order they load in. It is not a supersession. Baseline covers build-time filtering only, while the starter's version also appends (draft) to the title while serving, which is a genuinely useful writing affordance. Drop it and that marker disappears on a green build with no warning.

The site builds again, and it is still wearing the starter's hand-written <head>. That is the next page, and it is the one that looks alarming while it works.