# Module: pages/[slug]

@makerx/repository-website-generator / pages/[slug]

Table of contents

Functions

Functions

default

default(props): Element

Parameters

NameType
propsMarkdownPageProps

Returns

Element

Defined in

pages/[slug].tsx:16


getStaticPaths

getStaticPaths(context): GetStaticPathsResult<ParsedUrlQuery> | Promise<GetStaticPathsResult<ParsedUrlQuery>>

Define a list of paths to be statically generated if dynamic routes exist.

Link

https://nextjs.org/docs/basic-features/data-fetching/get-static-paths

Link

https://nextjs.org/docs/basic-features/typescript#static-generation-and-server-side-rendering

Example

export const getStaticPaths: GetStaticPaths = async () => { // ... }

Parameters

NameType
contextGetStaticPathsContext

Returns

GetStaticPathsResult<ParsedUrlQuery> | Promise<GetStaticPathsResult<ParsedUrlQuery>>

Defined in

node_modules/next/types/index.d.ts:221


getStaticProps

getStaticProps(context): GetStaticPropsResult<{ [key: string]: any; }> | Promise<GetStaticPropsResult<{ [key: string]: any; }>>

Static Site Generation feature for Next.js.

Link

https://nextjs.org/docs/basic-features/data-fetching/get-static-props

Link

https://nextjs.org/docs/basic-features/typescript#static-generation-and-server-side-rendering

Example

export const getStaticProps: GetStaticProps = async (context) => { // ... }

Parameters

NameType
contextGetStaticPropsContext<ParsedUrlQuery, PreviewData>

Returns

GetStaticPropsResult<{ [key: string]: any; }> | Promise<GetStaticPropsResult<{ [key: string]: any; }>>

Defined in

node_modules/next/types/index.d.ts:185