Eleventy
-
Install the package:
Terminal window npm install aeo.js -
Add the plugin in your
eleventy.config.js:const aeo = require('aeo.js/eleventy');module.exports = function (eleventyConfig) {eleventyConfig.addPlugin(aeo, {url: 'https://mysite.com',title: 'My Site',});}; -
Build your site:
Terminal window npx @11ty/eleventy
How it works
Section titled “How it works”The Eleventy plugin:
- Registers a transform that injects the AEO widget into every rendered
.htmlpage - Listens for the
eleventy.afterevent and reads Eleventy’s buildresults— each page’s URL and rendered HTML — to extract titles, descriptions, and full text content - Normalizes Eleventy’s trailing-slash URLs (
/about/→/about) and skips non-HTML output and 404 pages - Generates all AEO files (robots.txt, llms.txt, sitemap.xml, ai-index.json, …) into your Eleventy output directory (
_siteby default)
Configuration
Section titled “Configuration”Pass any AeoConfig options as the second argument to addPlugin. Add pages that Eleventy doesn’t emit as HTML via pages — your entries always win over auto-discovered ones:
eleventyConfig.addPlugin(aeo, { url: 'https://mysite.com', title: 'My Site', description: 'A site optimized for AI discovery', schema: { organization: { name: 'My Company' } },});If your output directory isn’t the default _site, either pass outDir or rely on the directories value Eleventy reports — the plugin reads it automatically.