Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace plugin

Callable

  • plugin(__namedParameters: { getNode: Function; htmlAst: Root; node: Node }, options: undefined | ({ replace?: Replacer } & PluginOptions)): Root
  • Parameters

    • __namedParameters: { getNode: Function; htmlAst: Root; node: Node }
      • getNode: Function
      • htmlAst: Root
      • node: Node
    • options: undefined | ({ replace?: Replacer } & PluginOptions)

    Returns Root

Index

Type aliases

Options

Options: { replace?: Replacer }

Type declaration

Replace

Replace: (params: ReplaceParams) => URL | string | void

A function type that replaces the given URL.

Type declaration

ReplaceParams

ReplaceParams: { attribute: string; element: Element; getNode: NodePluginArgs["getNode"]; node: Node; parent: Node; url: string }

The parameters of the replace function.

Type declaration

  • Readonly attribute: string

    The attribute name that has the URL

  • Readonly element: Element

    The Element that has the URL

  • Readonly getNode: NodePluginArgs["getNode"]

    Gatsby utility function to get a node from node ID

  • Readonly node: Node

    HtmlRehype node

  • Readonly parent: Node

    HtmlRehype's parent node

  • Readonly url: string

    The original URL to replace

Replacer

Replacer: Replace | ReadonlyArray<Replace>

Generated using TypeDoc