Eleventy Excellent
Add slugs to posts
Baseline registers every page under a slug, in one index shared across the whole site, so that wikilinks can resolve [[a-page]] to a URL. Registering the same slug twice throws, whether or not anything reads it, so a post whose filename matches a tag name collides with that tag's page:
Wikilink slug collision: "markdown" used by 2022-11-02-markdown.md and tagList.njk
Assume every page that emits a URL needs a stable, unique slug. Add one to the front matter of every file in src/content/posts/, at the top level alongside title:
---
title: 'Post with all the markdown'
slug: 'post-with-all-the-markdown'
description: 'A lot of markdown packages are installed to help you write your posts. All presets are personal preference.'
date: 2022-11-02
tags: ['markdown', 'feature']
---
The value is yours to choose and does not have to match the filename or the URL. It has to be unique across every page in the project, tag pages included.
You will not see the error yet, because the index only exists once Baseline is registered. This step and the next are what stop it being the first thing that happens when it is.
Set directory data keys
The other half of the same problem, and the reason common/ was emptied of pages. Nine machine outputs live there, and one of them collides too: _redirects.njk slugifies to redirects, which is also a tag.
A robots.txt has no identity to collide with, so rather than inventing slugs, opt these files out of having one. The keys go on the directory rather than into nine files:
// src/content/common/common.11tydata.js
export default {
layout: false,
eleventyExcludeFromCollections: true,
_internal: true
};
Get that filename exactly right. Eleventy reads <dirname>.11tydata.js and nothing else, so common.11ty.data.js, one dot out, is an ordinary module no build ever loads. Nothing warns you, and none of the three keys apply.
_internal is Baseline's own key, and it opts a file out of the three things Baseline builds for each page: its page context, its entry in the SEO graph, and its node in the content graph. A robots.txt needs none of them. Hoisting to the directory also means the tenth file added there is correct without anyone remembering.
Stop here and ship, if you like
This is the seam. Everything above adopts a set of conventions and Baseline has not run once, so the output is byte-for-byte what it was when you started. Everything below hands a surface over.