Skip to main content
ESC

Get Page Content

getPageContent is a utility that returns the markdown document and its title (generated for the structure).

Usage 

getPageContent is obtained as a result of initializing Robindoc.

It can be used, for example, for search functionality. For more details on general search configuration, refer to the Search page. For Next.js-specific setup, refer to the App Organization page.

const searchResults = [];
const { content, title } = await getPageContent("/docs/introduction");

if (content.includes(search)) {
searchResults.push({ href: "/docs/introduction", content, title });
}

Arguments 

pathname - the full path of the current page (e.g., /docs/introduction) must be provided to obtain the page data.

Previous
Get Meta
Next
Get Pages
Return to navigation