Skip to content

Commit

Permalink
docs: add info about getting config in loaders (#2147)
Browse files Browse the repository at this point in the history
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
  • Loading branch information
JohnCampionJr and brc-dd authored Mar 27, 2023
1 parent dae4168 commit f4355c7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/guide/data-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,13 @@ export default defineLoader({
}
})
```

## Configuration

To get the configuration information inside a loader, you can use some code like this:

```ts
import type { SiteConfig } from 'vitepress'

const config: SiteConfig = (globalThis as any).VITEPRESS_CONFIG
```

0 comments on commit f4355c7

Please sign in to comment.