diff --git a/.editorconfig b/.editorconfig index 17a416ed..ddf8bbc9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,6 @@ insert_final_newline = true indent_style = space indent_size = 4 -[*.yml] +[*.{yml,scss}] indent_style = space indent_size = 2 diff --git a/eleventy.config.js b/eleventy.config.js index a02caedc..b8918504 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -17,6 +17,7 @@ const fluidPlugin = require("eleventy-plugin-fluid"); const rssPlugin = require("@11ty/eleventy-plugin-rss"); const navigationPlugin = require("@11ty/eleventy-navigation"); const eleventyImage = require("@11ty/eleventy-img"); +const {exec} = require("child_process"); const exampleBlockShortcode = require("./src/_shortcodes/example-block.js"); const learningBlockShortcode = require("./src/_shortcodes/learning-block.js"); @@ -108,6 +109,13 @@ module.exports = function (eleventyConfig) { ].reverse(); }); + eleventyConfig.on("afterBuild", async () => { + // TODO: Once 11ty v3 is stable and the project updated to use it, it will be possible to use Pagefind's + // NodeJS API instead of calling `npx` with `exec`. This is because 11ty currently doesn't support ES6 modules. + // https://pagefind.app/docs/node-api/ + await exec("npx pagefind"); + }); + return { dir: { input: "src" diff --git a/pagefind.json b/pagefind.json new file mode 100644 index 00000000..67cd90b9 --- /dev/null +++ b/pagefind.json @@ -0,0 +1,7 @@ +{ + "site": "_site", + "excludeSelectors": [ + "footer", + ".toc-menu" + ] +} diff --git a/src/_includes/layouts/base.njk b/src/_includes/layouts/base.njk index 36147390..941ce238 100644 --- a/src/_includes/layouts/base.njk +++ b/src/_includes/layouts/base.njk @@ -16,7 +16,7 @@ {% block headerScripts %} {% endblock %} -
+ {% uioTemplate %} {% include "partials/global/header.njk" %}