Skip to content

Commit

Permalink
docs: add documentation for new graph/backlinks setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Fevol committed Dec 12, 2024
1 parent a997c11 commit 74ca980
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 37 deletions.
49 changes: 22 additions & 27 deletions docs/src/content/docs/configuration/backlinks.mdx
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
---
title: Backlinks
description: Learn how to configure the backlinks component in the sidebar.
description: Learn how to configure the backlinks component.
sidebar:
order: 3
sitemap:
pageTitle: Backlinks Configuration
---

This page provides information on how you can configure the backlinks component in the sidebar.
This page provides information on how you can configure the backlinks component.

## General configuration
## Render

To configure the backlinks component in the sidebar, refer to the [Starlight Site Graph backlinks configuration](https://fevol.github.io/starlight-site-graph/configuration/backlinks) for more information.

## Examples

Some common examples are provided below to showcase how you might configure the backlinks component in the sidebar.

### Disable the backlinks on every page
If you want to _disable_ the backlinks component, you can do so by setting `backlinks` to `false` in the plugin settings.

```diff lang="js"
// astro.config.mjs
import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightThemeObsidian from 'starlight-theme-obsidian'

export default defineConfig({
integrations: [
starlight({
plugins: [starlightThemeObsidian({
+ backlinksConfig: {
+ visibilityRules: []
+ }
})],
title: 'My Docs',
}),
],
})
// astro.config.mjs
import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightThemeObsidian from 'starlight-theme-obsidian'

export default defineConfig({
integrations: [
starlight({
plugins: [starlightThemeObsidian({
+ backlinks: false
})],
title: 'My Docs',
}),
],
})
```

## Component configuration

For configuration of the backlinks component itself, check out the [Starlight Site Graph backlinks configuration](https://fevol.github.io/starlight-site-graph/configuration/backlinks).
38 changes: 30 additions & 8 deletions docs/src/content/docs/configuration/graph.mdx
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
---
title: Graph
description: Learn how to configure the graph component in the sidebar.
description: Learn how to configure the graph component.
sidebar:
order: 2
sitemap:
pageTitle: Graph Configuration
---

This page provides information on how you can configure the graph component in the sidebar.
This page provides information on how you can configure the graph component.

## General configuration
## Render

To configure the graph component in the sidebar, refer to the [Starlight Site Graph graph configuration](https://fevol.github.io/starlight-site-graph/configuration/graph) for more information.
If you want to _disable_ the graph component, you can do so by setting `graph` to `false` in the plugin settings.

```diff lang="js"
// astro.config.mjs
import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightThemeObsidian from 'starlight-theme-obsidian'

export default defineConfig({
integrations: [
starlight({
plugins: [starlightThemeObsidian({
+ graph: false
})],
title: 'My Docs',
}),
],
})
```

## Component configuration

For configuration of the graph component itself, check out the [Starlight Site Graph graph configuration](https://fevol.github.io/starlight-site-graph/configuration/graph).

## Examples
Some common examples are provided below to showcase how you might configure the graph component in the sidebar.

### Disable the graph on every page
### Make the current node larger

```diff lang="js"
// astro.config.mjs
Expand All @@ -29,7 +50,9 @@ Some common examples are provided below to showcase how you might configure the
starlight({
plugins: [starlightThemeObsidian({
+ graphConfig: {
+ visibilityRules: []
+ nodeCurrentStyle: {
+ shapeSize: 25
+ }
+ }
})],
title: 'My Docs',
Expand All @@ -38,7 +61,6 @@ Some common examples are provided below to showcase how you might configure the
})
```


### Remove all quick actions from graph

```diff lang="js"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/configuration/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ In general, you can configure the underlying Starlight Site Graph in several way
// astro.config.mjs
import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightSiteGraph from 'starlight-site-graph'
import starlightThemeObsidian from 'starlight-theme-obsidian'
export default defineConfig({
integrations: [
starlight({
plugins: [starlightSiteGraph({
plugins: [starlightThemeObsidian({
+ debug: false, // See "General Settings"
+ sitemapCongig: {}, // See "Sitemap Settings"
+ graphConfig: {}, // See "Graph Settings"
Expand Down
22 changes: 22 additions & 0 deletions docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,25 @@ import { PackageManagers } from 'starlight-package-managers'
That's it! You should now see the Starlight Obsidian theme applied to your Starlight website.

You can now further configure the theme and the graph component in the sidebar by following the [configuration](/starlight-theme-obsidian/configuration/graph/) guide.

:::note
If you want to _disable_ the graph and backlinks components which are added by default, you can do so by applying the following settings:
```diff lang="js"
// astro.config.mjs
import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightThemeObsidian from 'starlight-theme-obsidian'

export default defineConfig({
integrations: [
starlight({
plugins: [starlightThemeObsidian({
+ backlinks: false,
+ graph: false
})],
title: 'My Docs',
}),
],
})
```
:::

0 comments on commit 74ca980

Please sign in to comment.