Eleventy Plugin Baseline

A magic carpet ride

Documentation — Table of Contents

Debugging & Navigator

Use Baseline’s debug helpers to inspect Eleventy data. You’ll add a page that uses _inspect, _json, and _keys, and optionally enable the navigator template for a full data snapshot. Keep navigator features off in production.

What you’ll build

Prerequisites

1) Enable (or skip) the navigator template

If you want the full snapshot page for local use only, enable the navigator template. If you skip this, leave enableNavigatorTemplate false and continue with the filters. The debug filters work without the navigator page.

import baseline, { config as baselineConfig } from "@apleasantview/eleventy-plugin-baseline";

/** @param {import("@11ty/eleventy").UserConfig} eleventyConfig */
export default function (eleventyConfig) {
  eleventyConfig.addPlugin(baseline({
    enableNavigatorTemplate: true, // local dev only; disable for production
  }));
}

export const config = baselineConfig;

2) Add a debug page

Create src/content/pages/debug-playground.md:

---
title: "Debug Playground"
description: "Inspect data with Baseline debug helpers."
permalink: "/debug-playground/"
layout: "layouts/base.njk"
---

## Collections (first 3)
<pre>
{% for item in collections.all.slice(0, 3) %}
- {{ item.url }}
{% endfor %}
</pre>

## Page keys
<pre>{{ page | _keys }}</pre>

## Page data (inspect)
<pre>{{ page | _inspect({ getters: true, depth: 2 }) }}</pre>

## Page data (json)
<pre>{{ page | _json(2) }}</pre>

3) Use navigator helpers inline

If you want to see the full data/context on this page:

<h2>Navigator snapshot (inline)</h2>
<pre>{{ _navigator() | _inspect() }}</pre>

_navigator() renders the full snapshot; _context() renders just the current context. This dumps a large snapshot—use only in local dev.

4) Run and inspect

npx rimraf dist/ && npm run dev

5) Visit the navigator template (optional)

With enableNavigatorTemplate: true, Baseline exposes a virtual page at /navigator-core.html. Keep this disabled in production.

6) Production considerations

7) Next steps

Previous: Head & SEO Basics

Next: Sitemaps & Drafts