Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IOptions<M>

Type parameters

  • M: Mode = "render"

Hierarchy

  • IOptions

Index

Properties

Optional directories

directories: string | string[]

The directories to load static files from..

default

statics

Optional excludes

excludes: string | string[]

Glob patterns for excluding files.

default

[]

Optional extensions

extensions: string | string[]

The allowable extension.

default

[md, html]

Optional fallback

fallback: boolean | "blocking"

Indicates fallback mode for statically generated content. Read issue below. If the content can be loaded quickly then you likely want "blocking" which is the default. Use "true" if you need to show a loading state. Setting to "false" may result in a blank rendered page when using locales.

see

https://github.com/vercel/next.js/issues/15637

default

blocking

Optional highlight

highlight: boolean

When true apply syntax highlighting to the content before sending to component props.

default

false

Optional mode

mode: M

When creating an instance "getStaticProps" can return either rendered content or it can return a props object containing "slugs" or paths you can use for creating links to rendered static files.

default

render

Optional onBeforeRender

onBeforeRender: (content: string) => string

Simple callback you can use for manipulating output before rendered as props.content

param

the parsed markdown, html and or highlighted content.

Type declaration

    • (content: string): string
    • Parameters

      • content: string

      Returns string

Optional onSlugify

onSlugify: (segments: string[], metadata?: { ext: string; locale?: string; root: string }) => string

Optional method used to create slugs or keys used to generate links.

param

array of path segments excluding root directory, locale and extension.

param

an object containing the root directory, ext and locale if exists.

Type declaration

    • (segments: string[], metadata?: { ext: string; locale?: string; root: string }): string
    • Parameters

      • segments: string[]
      • Optional metadata: { ext: string; locale?: string; root: string }
        • ext: string
        • Optional locale?: string
        • root: string

      Returns string

Optional paramKey

paramKey: string

The param key used to identify the dynamic file to be loaded and the route param.

default

slug

Optional sanitize

sanitize: null | string | false | string[]

Define specific extensions to be sanitized or use '*' to sanitize all output.

example

['.html']

see

https://reactjs.org/docs/dom-elements.html

default

*

Generated using TypeDoc