search bar timeeee
This commit is contained in:
@@ -6,6 +6,7 @@ import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
|
||||
import { attrs } from "@mdit/plugin-attrs";
|
||||
import { chunk } from "lodash-es";
|
||||
import path from "node:path";
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
import pluginFilters from "./_config/filters.js";
|
||||
|
||||
@@ -136,6 +137,12 @@ export default async function(eleventyConfig) {
|
||||
/* Watch when serving */
|
||||
eleventyConfig.addWatchTarget("css");
|
||||
eleventyConfig.addWatchTarget("js");
|
||||
|
||||
/* Implement search */
|
||||
/* From https://rknight.me/blog/using-pagefind-with-eleventy-for-search/ */
|
||||
eleventyConfig.on('eleventy.after', () => {
|
||||
execSync(`npx pagefind --site _site --glob \"**/*.html\"`, { encoding: 'utf-8' })
|
||||
});
|
||||
};
|
||||
|
||||
export const config = {
|
||||
|
||||
Reference in New Issue
Block a user