Skip to content

Commit

Permalink
docs: update sources (#1664)
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Nov 8, 2022
1 parent bfadb27 commit 6586262
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
23 changes: 16 additions & 7 deletions docs/content/4.api/3.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ The watcher is a development feature and will not be included in production.

## `sources`

- Type: `Array<Object | String>`{lang=ts}
- Default: `['content']`{lang=ts}
- Type: `Record<String, Object>`{lang=ts}
- Default: `{}`{lang=ts}

Define different sources for contents.

Expand All @@ -82,20 +82,29 @@ Contents can be located in multiple places, in multiple directories, or in remot
```ts [nuxt.config.ts]
export default defineNuxtConfig({
content: {
sources: [
'content',
{
name: 'fa-ir',
sources: {
// overwrite default source AKA `content` directory
content: {
driver: 'fs',
prefix: '/docs', // All contents inside this source will be prefixed with `/docs`
base: resolve(__dirname, 'content')
}
// Additional sources
fa: {
prefix: '/fa', // All contents inside this source will be prefixed with `/fa`
driver: 'fs',
// ...driverOptions
base: resolve(__dirname, 'content-fa') // Path for source directory
}
]
}
}
})
```

::Alert
It is highly recommended to prevent modifying default source. If you want to load contents from another location, consider adding an additional source.
::

## `ignores`

- Type: `string[] | object[]`{lang=ts}
Expand Down
4 changes: 0 additions & 4 deletions docs/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,21 @@ export default defineNuxtConfig({
content: {
sources: {
v1: {
name: 'v1',
prefix: '/v1',
driver: 'fs',
base: resolve(__dirname, 'content-v1/en')
},
'v1-ja': {
name: 'v1-ja',
prefix: '/ja/v1',
driver: 'fs',
base: resolve(__dirname, 'content-v1/ja')
},
'v1-fr': {
name: 'v1-fr',
prefix: '/fr/v1',
driver: 'fs',
base: resolve(__dirname, 'content-v1/fr')
},
'v1-ru': {
name: 'v1-ru',
prefix: '/ru/v1',
driver: 'fs',
base: resolve(__dirname, 'content-v1/ru')
Expand Down

0 comments on commit 6586262

Please sign in to comment.