Getting Started
Starlight Site Graph is a Starlight plugin that seamlessly adds a customizable graph to your site, visualizing links between your pages for easy navigation.
Check out the configuration guide to learn more about the plugin’s features.
Prerequisites
You will need to have a Starlight website set up. If you don’t have one yet, you can follow the “Getting Started” guide in the Starlight docs to create one.
Installation (Starlight)
- Starlight Site Graph is a Starlight plugin that you can install using your favorite package manager:
- Configure the plugin in your Starlight configuration in the
astro.config.mjs
file. - Add the Site Graph content schema
to your pages to enable type checking on the page’s frontmatter, you will need to
define the
src/content/config.ts
file if it doesn’t exist yet. - Start the development server to see the graph in action.
That’s it! You should now see the Starlight Site Graph is now added to your Starlight website.
If you want to configure the graph component, sitemap generation or backlinks, check out the configuration guide.
Installation (Astro)
While the plugin is mainly developed with Starlight support in mind, it is also possible to add the
<PageGraph>
or <PageBacklinks>
components
to regular Astro projects (without a sidebar), though it will require a little more manual setup.
- Starlight Site Graph is a package that contains an integration and several components, which you can install using your favorite package manager:
- Add the sitemap generation integration of the plugin in your
astro.config.mjs
file. You may need to enableprefetch
if you are encountering errors. - Add the Site Graph content schema
to your pages to enable type checking on the page’s frontmatter,
you will need to define the
src/content/config.ts
file if it doesn’t exist yet.
If you already have a collection defined, you can extend the existing schema with thesiteGraphSchema
: - You can now add the plugin’s components directly to your
.astro
,.mdx
or.mdoc
pages (for the latter two, the proper integrations need to be added).
An example: For more info, check out the components guide. - Start the development server to see the graph in action.