Skip to content

Commit ee5e97f

Browse files
committed
docs: update config with alphabetical order
1 parent 92e7591 commit ee5e97f

File tree

1 file changed

+112
-113
lines changed

1 file changed

+112
-113
lines changed

docs/content/docs/1.getting-started/3.configuration.md

Lines changed: 112 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -13,94 +13,6 @@ export default defineNuxtConfig({
1313
})
1414
```
1515

16-
## `database`
17-
18-
By default Nuxt Content uses a local SQLite database to store and query content. If you like to use another database or you plan to deploy on Cloudflare Workers, you can modify this option.
19-
20-
Here is the list of supported database adapters:
21-
22-
### `SQLite`
23-
24-
If you want to change default database location and move it to elsewhere you can use `sqlite` adapter to do so. This is the default value to `database` option.
25-
26-
```ts [nuxt.config.ts]
27-
export default defineNuxtConfig({
28-
content: {
29-
database: {
30-
type: 'sqlite',
31-
binding: 'SQLITE_DB_LOCATION'
32-
}
33-
}
34-
})
35-
```
36-
37-
### `D1`
38-
39-
If you plan to deploy your application to Couldflare workers, you need to use `d1` database adapter. Create `d1` binding in Cloudflare dashboard and fill the `binding` field.
40-
41-
```ts [nuxt.config.ts]
42-
export default defineNuxtConfig({
43-
content: {
44-
database: {
45-
type: 'd1',
46-
binding: 'CF_BINDING_NAME'
47-
}
48-
}
49-
})
50-
```
51-
52-
### `Postgres`
53-
54-
If you plan to deploy your application using PostgreSql database you need to use `postgres` database adapter.
55-
56-
First, make sure to install the `pg` package:
57-
58-
```bash [Terminal]
59-
npx nypm i pg
60-
```
61-
62-
Then, configure the `postgres` adapter in your `nuxt.config.ts`:
63-
64-
```ts [nuxt.config.ts]
65-
export default defineNuxtConfig({
66-
content: {
67-
database: {
68-
type: 'postgres',
69-
url: process.env.POSTGRES_URL,
70-
/* Other options for `pg` */
71-
}
72-
}
73-
})
74-
```
75-
76-
### `LibSQL`
77-
78-
If you plan to deploy your application using LibSQL database you need to use `libsql` database adapter.
79-
80-
First, make sure to install the `@libsql/client` package:
81-
82-
```bash [Terminal]
83-
npx nypm i @libsql/client
84-
```
85-
86-
Then, configure the `libsql` adapter in your `nuxt.config.ts`:
87-
88-
```ts [nuxt.config.ts]
89-
export default defineNuxtConfig({
90-
content: {
91-
database: {
92-
type: 'libsql',
93-
url: process.env.TURSO_DATABASE_URL,
94-
authToken: process.env.TURSO_AUTH_TOKEN,
95-
}
96-
}
97-
})
98-
```
99-
100-
::note
101-
The most popular LibSQL hosting services is [Turso](https://turso.tech/).
102-
::
103-
10416
## `build`
10517

10618
Nuxt Content read and parse all the available contents at built time. This option let you control over parsing contents.
@@ -343,51 +255,93 @@ export default defineNuxtConfig({
343255

344256
Read more about adding languages in the [Shiki documentation](https://github.com/shikijs/shiki/blob/main/docs/languages.md#adding-grammar).
345257

346-
## `watch`
258+
## `database`
347259

348-
```ts [Default]
349-
watch: {
350-
enabled: true,
351-
ws: { port: 4000, showURL: false }
352-
}
260+
By default Nuxt Content uses a local SQLite database to store and query content. If you like to use another database or you plan to deploy on Cloudflare Workers, you can modify this option.
261+
262+
Here is the list of supported database adapters:
263+
264+
### `SQLite`
265+
266+
If you want to change default database location and move it to elsewhere you can use `sqlite` adapter to do so. This is the default value to `database` option.
267+
268+
```ts [nuxt.config.ts]
269+
export default defineNuxtConfig({
270+
content: {
271+
database: {
272+
type: 'sqlite',
273+
binding: 'SQLITE_DB_LOCATION'
274+
}
275+
}
276+
})
353277
```
354278

355-
Configure content hot reload in development.
279+
### `D1`
356280

357-
Value:
358-
- `enabled`{lang=ts}: Enable/Disable hot reload.
359-
- `port`{lang=ts}: Select the port used for the WebSocket server.
360-
- `showURL`{lang=ts}: Toggle URL display in dev server boot message.
281+
If you plan to deploy your application to Couldflare workers, you need to use `d1` database adapter. Create `d1` binding in Cloudflare dashboard and fill the `binding` field.
361282

362-
::callout
363-
The watcher is a development feature and will not be included in production.
364-
::
283+
```ts [nuxt.config.ts]
284+
export default defineNuxtConfig({
285+
content: {
286+
database: {
287+
type: 'd1',
288+
binding: 'CF_BINDING_NAME'
289+
}
290+
}
291+
})
292+
```
365293

366-
::code-group
367-
```ts [Enabled]
294+
### `Postgres`
295+
296+
If you plan to deploy your application using PostgreSql database you need to use `postgres` database adapter.
297+
298+
First, make sure to install the `pg` package:
299+
300+
```bash [Terminal]
301+
npx nypm i pg
302+
```
303+
304+
Then, configure the `postgres` adapter in your `nuxt.config.ts`:
305+
306+
```ts [nuxt.config.ts]
368307
export default defineNuxtConfig({
369308
content: {
370-
watch: {
371-
ws: {
372-
port: 4000,
373-
showURL: true
374-
}
309+
database: {
310+
type: 'postgres',
311+
url: process.env.POSTGRES_URL,
312+
/* Other options for `pg` */
375313
}
376314
}
377315
})
378316
```
379317

380-
```ts [Disabled]
318+
### `LibSQL`
319+
320+
If you plan to deploy your application using LibSQL database you need to use `libsql` database adapter.
321+
322+
First, make sure to install the `@libsql/client` package:
323+
324+
```bash [Terminal]
325+
npx nypm i @libsql/client
326+
```
327+
328+
Then, configure the `libsql` adapter in your `nuxt.config.ts`:
329+
330+
```ts [nuxt.config.ts]
381331
export default defineNuxtConfig({
382332
content: {
383-
watch: {
384-
enabled: false
333+
database: {
334+
type: 'libsql',
335+
url: process.env.TURSO_DATABASE_URL,
336+
authToken: process.env.TURSO_AUTH_TOKEN,
385337
}
386338
}
387339
})
388340
```
389-
::
390341

342+
::note
343+
The most popular LibSQL hosting services is [Turso](https://turso.tech/).
344+
::
391345

392346
## `renderer`
393347

@@ -442,3 +396,48 @@ export default defineNuxtConfig({
442396
}
443397
})
444398
```
399+
400+
## `watch`
401+
402+
```ts [Default]
403+
watch: {
404+
enabled: true,
405+
ws: { port: 4000, showURL: false }
406+
}
407+
```
408+
409+
Configure content hot reload in development.
410+
411+
Value:
412+
- `enabled`{lang=ts}: Enable/Disable hot reload.
413+
- `port`{lang=ts}: Select the port used for the WebSocket server.
414+
- `showURL`{lang=ts}: Toggle URL display in dev server boot message.
415+
416+
::callout
417+
The watcher is a development feature and will not be included in production.
418+
::
419+
420+
::code-group
421+
```ts [Enabled]
422+
export default defineNuxtConfig({
423+
content: {
424+
watch: {
425+
ws: {
426+
port: 4000,
427+
showURL: true
428+
}
429+
}
430+
}
431+
})
432+
```
433+
434+
```ts [Disabled]
435+
export default defineNuxtConfig({
436+
content: {
437+
watch: {
438+
enabled: false
439+
}
440+
}
441+
})
442+
```
443+
::

0 commit comments

Comments
 (0)