Skip to content

Commit

Permalink
Merge pull request #19 from HiDeoo/hd-docs-deploy-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo authored May 26, 2024
2 parents 9ba9228 + 706a3d3 commit dd6f214
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default defineConfig({
{ label: 'Project Structure', link: '/guides/project-structure/' },
{ label: 'Ignoring Content', link: '/guides/ignoring-content/' },
{ label: 'Features', link: '/guides/features/' },
{ label: 'Deployment', link: '/guides/deployment/' },
],
},
obsidianSidebarGroup,
Expand Down
4 changes: 3 additions & 1 deletion docs/src/content/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ The name of the output directory containing the generated Obsidian vault pages r
Whether the Starlight Obsidian plugin should skip the generation of the Obsidian vault pages.

This is useful to disable generating the Obsidian vault pages when deploying on platforms that do not have access to the Obsidian vault.
This will require you to build and commit the pages locally ahead of time.
This will require you to [build](https://docs.astro.build/en/reference/cli-reference/#astro-build) and commit vault pages before deploying your site.

Read more about deploying your site in the [“Deployment”](/guides/deployment/) guide.

### `sidebar`

Expand Down
34 changes: 34 additions & 0 deletions docs/src/content/docs/guides/deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Deployment
description: Learn how to deploy your Obsidian vault pages with the Starlight Obsidian plugin.
---

When building your documentation, the Starlight Obsidian plugin will generate pages from your Obsidian vault.

## Deploying your vault pages

When deploying your Starlight project, the target platform may not have access to the Obsidian vault or it would be impractical to include the vault in the deployment.
In such cases, you can use the [`skipGeneration` configuration option](/configuration/#skipgeneration) to disable the generation of vault pages on specific platforms.

When using this option, you will need to [build](https://docs.astro.build/en/reference/cli-reference/#astro-build) and commit the generated vault pages before deploying your site.

```js {11-12}
// astro.config.mjs
import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightObsidian from 'starlight-obsidian'

export default defineConfig({
integrations: [
starlight({
plugins: [
starlightObsidian({
// Disable generating vault pages when deploying on Vercel.
skipGeneration: !!process.env['VERCEL'],
}),
],
title: 'My Docs',
}),
],
})
```

0 comments on commit dd6f214

Please sign in to comment.