import path from 'node:path' import { IdAttributePlugin, InputPathToUrlTransformPlugin, HtmlBasePlugin } from '@11ty/eleventy' import { feedPlugin } from '@11ty/eleventy-plugin-rss' import pluginSyntaxHighlight from '@11ty/eleventy-plugin-syntaxhighlight' import pluginNavigation from '@11ty/eleventy-navigation' import { eleventyImageTransformPlugin } from '@11ty/eleventy-img' import pluginFilters from './config/filters.js' /** @param {import("@11ty/eleventy").UserConfig} eleventyConfig */ export default async function (eleventyConfig) { // 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 } }) // Site-wide static assets (fonts, favicon, interior-panel textures, logo) served at /assets/** eleventyConfig.addPassthroughCopy('assets') // Page images live next to their page in content//images/ and are served verbatim // at /content//images/ (used for full-resolution download links). eleventyConfig.addPassthroughCopy('content/**/images') eleventyConfig.addPassthroughCopy('./content/feed/pretty-atom-feed.xsl') eleventyConfig.addWatchTarget('css/**/*.css') eleventyConfig.addWatchTarget('assets/**') eleventyConfig.addWatchTarget('content/**/*.{svg,webp,png,jpg,jpeg,gif}') // Rebuild when the generated OpenAPI spec changes (see data/apiSpec.js). Run // `npm run spec:build` in ../api-spec to regenerate it. eleventyConfig.addWatchTarget(path.resolve(import.meta.dirname, '../api-spec/build/spec.json')) // Per-page bundles, see https://github.com/11ty/eleventy-plugin-bundle // Bundle