Skip to main content
Module

x/lume/plugins/search.ts

πŸ”₯ Static site generator for Deno πŸ¦•
Very Popular
Go to Latest
File
import { merge } from "../core/utils/object.ts";
import type Site from "../core/site.ts";import type Searcher from "../core/searcher.ts";
export interface Options { /** The helper name */ name?: string;}
export const defaults: Options = { name: "search",};
/** Register the plugin to enable the `search` helpers */export default function (userOptions?: Options) { const options = merge(defaults, userOptions);
return (site: Site) => { site.data(options.name, site.search); };}
/** Extends Data interface */declare global { namespace Lume { export interface Data { /** * The searcher helper * @see https://lume.land/plugins/search/ */ search: Searcher; } }}