function deferPagefind
deferPagefind()

Lume plugin to defer the loading of Pagefind CSS and JS.

This plugin modifies the Pagefind CSS link and JS script tags to ensure they are loaded asynchronously, improving page load performance.

It sets media="print" and onload="this.media='all'" on the CSS link and adds the defer attribute to the JS script.

Examples

// In your Lume _config.ts: import lume from "lume/mod.ts"; import { deferPagefind, externalLinksIcon } from "hibana/mod.ts";

const site = lume();

// == NEAR BOTTOM of your _config.ts, after other plugins: // Specify the base URL site.process([".html"], externalLinksIcon("https://esolia.co.jp")); site.process([".html"], deferPagefind());

export default site;

Return Type