Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.61 KB

get-page-snapshot.mdx

File metadata and controls

46 lines (34 loc) · 1.61 KB
title description
getPageSnapshot
An instance method that fetches a snapshot of a Makeswift page at a given path. This snapshot is only intended to be rendered by the `<Page>` component.

import PagesCatchAllExample from "/snippets/pages-router/catch-all.mdx" import PagesCatchAllLocalizedExample from "/snippets/pages-router/catch-all-localized.mdx"

Arguments

  1. The path of the page.
  2. Options for site version and locale. The return value from [`getSiteVersion`](/developer/reference/client/get-site-version). A valid locale string.

Return type

An opaque `Snapshot` object that is only intended to be rendered by the [``](/developer/reference/components/page) component.

Examples

Basic usage

The following example sets up a catch all route where page snapshots are fetched from Makeswift and rendered using the <Page> component.

Localization

The following example uses the locale param in getStaticProps to fetch a localized snapshot of a page.