@nolebase/vitepress-plugin-meta
Version:
A vitepress plugin to add <meta> (excerpts, author, authors, etc.) to your rendered pages to maximize SEO and social media sharing capabilities.
34 lines (31 loc) • 1.06 kB
text/typescript
import { TransformContext, HeadConfig } from 'vitepress';
interface TransformHeadMetaOptions {
/**
* Max length of the excerpt in characters for the meta description.
*
* @default 200
*/
length?: number;
/**
* CSS selector for the content element.
*
* @default '#VPContent div.content main .vp-doc div'
*/
contentSelector?: string;
/**
* CSS selector for the content element to remove.
*
* @default ['h1','.nolebase-page-properties-container']
*/
removeContentSelector?: string[];
/**
* Whether to use the tagline from the frontmatter for the home layout.
*/
useTaglineForHomeLayout?: boolean;
/**
* Handle the excerpt before adding it to the head.
*/
handleExcerpt?: (excerpt: string, context: Readonly<TransformContext>) => Promise<string>;
}
declare function transformHeadMeta(options?: TransformHeadMetaOptions): (head: HeadConfig[], context: Readonly<TransformContext>) => Promise<HeadConfig[] | void>;
export { transformHeadMeta };