Skip to content

Commit

Permalink
Merge branch 'v3'
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Feb 7, 2025
2 parents bfc58cc + 311609c commit 2ac7c39
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
6 changes: 3 additions & 3 deletions docs/content/docs/1.getting-started/3.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,22 +302,22 @@ export default defineNuxtConfig({
content: {
database: {
type: 'sqlite',
binding: 'SQLITE_DB_LOCATION'
filename: 'SQLITE_DB_LOCATION'
}
}
})
```

### `D1`

If you plan to deploy your application to Cloudflare workers, you need to use the `d1` database adapter. Create a `d1` binding in the Cloudflare dashboard and fill in the `binding` field.
If you plan to deploy your application to Cloudflare workers, you need to use the `d1` database adapter. Create a `d1` binding in the Cloudflare dashboard and fill in the `bindingName` field.

```ts [nuxt.config.ts]
export default defineNuxtConfig({
content: {
database: {
type: 'd1',
binding: 'CF_BINDING_NAME'
bindingName: 'CF_BINDING_NAME'
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/1.getting-started/4.migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The new API is backed by SQL and content queries happens within a specific colle
export default defineNuxtConfig({
content: {
preview: {
api: 'https://api.nuxt.studio
api: 'https://api.nuxt.studio'
}
},
})
Expand Down
20 changes: 13 additions & 7 deletions docs/content/docs/3.files/2.yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,20 @@ url: https://github.com/larbish
Now we can query authors:
```ts
```vue
<script lang="ts" setup>
// Find a single author
const theAuthor = await queryCollection('authors')
.where('stem', '=', 'larbish')
.first()
const { data: author } = await useAsyncData('larbish', () => {
return queryCollection('authors')
.where('stem', '=', 'larbish')
.first()
})

// Get all authors
const authors = await queryCollection('authors')
.order('name', 'DESC')
.all()
const { data: authors } = await useAsyncData('authors', () => {
return queryCollection('authors')
.order('name', 'DESC')
.all()
})
</script>
```
20 changes: 13 additions & 7 deletions docs/content/docs/3.files/3.json.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ Each file in `data` collection should contain only one object, therefore having

Now we can query authors:

```ts
```vue
<script lang="ts" setup>
// Find a single author
const theAuthor = await queryCollection('authors')
.where('stem', '=', 'larbish')
.first()
const { data: author } = await useAsyncData('larbish', () => {
return queryCollection('authors')
.where('stem', '=', 'larbish')
.first()
})
// Get all authors
const authors = await queryCollection('authors')
.order('name', 'DESC')
.all()
const { data: authors } = await useAsyncData('authors', () => {
return queryCollection('authors')
.order('name', 'DESC')
.all()
})
</script>
```

0 comments on commit 2ac7c39

Please sign in to comment.