From 74ca980c0e75009547d9a99b7d448a06f38e2d8e Mon Sep 17 00:00:00 2001 From: Fevol <8179397+fevol@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:46:29 +0100 Subject: [PATCH] docs: add documentation for new graph/backlinks setting --- .../content/docs/configuration/backlinks.mdx | 49 +++++++++---------- docs/src/content/docs/configuration/graph.mdx | 38 +++++++++++--- docs/src/content/docs/configuration/index.mdx | 4 +- docs/src/content/docs/getting-started.mdx | 22 +++++++++ 4 files changed, 76 insertions(+), 37 deletions(-) diff --git a/docs/src/content/docs/configuration/backlinks.mdx b/docs/src/content/docs/configuration/backlinks.mdx index 18ba17c..b904ac1 100644 --- a/docs/src/content/docs/configuration/backlinks.mdx +++ b/docs/src/content/docs/configuration/backlinks.mdx @@ -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). diff --git a/docs/src/content/docs/configuration/graph.mdx b/docs/src/content/docs/configuration/graph.mdx index 745e39d..0ad556d 100644 --- a/docs/src/content/docs/configuration/graph.mdx +++ b/docs/src/content/docs/configuration/graph.mdx @@ -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 @@ -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', @@ -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" diff --git a/docs/src/content/docs/configuration/index.mdx b/docs/src/content/docs/configuration/index.mdx index 45fa2d6..f214e15 100644 --- a/docs/src/content/docs/configuration/index.mdx +++ b/docs/src/content/docs/configuration/index.mdx @@ -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" diff --git a/docs/src/content/docs/getting-started.mdx b/docs/src/content/docs/getting-started.mdx index 1a9aa39..dde0dd5 100644 --- a/docs/src/content/docs/getting-started.mdx +++ b/docs/src/content/docs/getting-started.mdx @@ -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', + }), + ], +}) +``` +:::