Skip to content

<Backlinks>

The <Backlinks> component visualizes all the backlinks of a particular slug in an ordered list. This component makes use of the sitemap prop to determine the titles of the backlinks prop.

import { Backlinks } from 'starlight-site-graph/components';

Display backlinks for a custom page.

<Backlinks
backlinks={['node/1', 'node/2']}
sitemap={{
"node/": { title: "Node", exists: true, backlinks: ["node/1", "node/2"] },
"node/1": { title: "Node 1", exists: true, links: ["node/"] },
"node/2": { title: "Node 2", exists: true, links: ["node/"] }
}}
/>
Preview

The <Backlinks> component accepts the following props:

type: string[]

An array of slugs that represent the backlinks of the current page.

type: sitemapSchema

The sitemap object, which contains all the information about pages, links and other information. For more information on how this object should be structured, check out the sitemap configuration documentation.