Skip to content

Commit

Permalink
docs: fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Nov 7, 2024
1 parent b49997c commit 0d2c690
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 33 deletions.
6 changes: 3 additions & 3 deletions docs/content/docs/1.getting-started/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Welcome to Nuxt Content v3, a major upgrade that brings enhanced performance and

Collections organize related items within your project, helping you manage large datasets more efficiently. Key benefits include:

- **Structured Data**: Configure database architecture and define collections in [`content.config.ts`](/getting-started/collections#defining-collections)
- **Structured Data**: Configure database architecture and define collections in [`content.config.ts`](/docs/getting-started/collections#defining-collections)
- **Type-safe Queries**: Direct TypeScript integration across all utilities
- **Automatic Validation**: Ensure data consistency across frontmatter fields and data files (json, yml...)
- **Advanced Query Builder**: Filter, sort, and paginate your collections with ease
- **Studio Integration**: Enhanced form generation and optimal editing experience through [Studio](https://nuxt.studio)

Learn more about [Content Collections](/getting-started/collections).
Learn more about [Content Collections](/docs/getting-started/collections).

### Improved Performance

Expand All @@ -29,7 +29,7 @@ V3 addresses this by transitioning to SQL-based storage in production. This swit
Benefits include:

- **Optimized Queries**: SQL storage enables ultra-fast data retrieval
- **Universal Compatibility**: Our adapter-based system integrates SQL databases across all deployment modes (static, server-side, SPA, edge) and platforms. See our [platform deployment options](/deploy/node) for details. We welcome community contributions for additional adapters.
- **Universal Compatibility**: Our adapter-based system integrates SQL databases across all deployment modes (static, server-side, SPA, edge) and platforms. See our [platform deployment options](/docs/deploy/node) for details. We welcome community contributions for additional adapters.

### TypeScript Integration

Expand Down
37 changes: 36 additions & 1 deletion docs/content/docs/1.getting-started/2.installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,46 @@ export const collections = {
This configuration creates a default `content` collection that processes all Markdown files in your project. You can customize the collection settings based on your needs.

::tip
The `type: page` setting specifies that each file in the collection represents a [Markdown page](/usage/markdown).
The `type: page` setting specifies that each file in the collection represents a [Markdown page](/docs/usage/markdown).
::

::note{to="/getting-started/collections"}
Learn more in our **Collections guide**.
::

### Create your First Markdown Page

Create a `content/index.md` file in your project root directory:

```md [content/index.md]
# My First Page

Here is some content.
```

Read more about writing [Markdown pages](/docs/usage/markdown).

### Display your Page

Create a `pages/index.vue` file and display the page content:

```vue [pages/index.vue]
<script setup lang="ts">
const { data: home } = await useAsyncData(() => queryCollection('content').path('/').first())
useSeoMeta({
title: home.value?.title,
description: home.value?.description
})
</script>
<template>
<ContentRenderer v-if="home" :value="home" />
<div v-else>Home not found</div>
</template>
```

::tip{icon="i-lucide-rocket"}
That's it! You've now created your first Nuxt Content page.
::

2 changes: 1 addition & 1 deletion docs/content/docs/1.getting-started/3.collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const collections = {

## Querying Collections

Use the [`queryCollection`](/api/query-collection) util to fetch one or all items from a collection:
Use the [`queryCollection`](/docs/composables/query-collection) util to fetch one or all items from a collection:

```vue [pages/blog.vue]
<script setup lang="ts">
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/1.getting-started/5.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ type Highlight = false | object
```
::
Nuxt Content uses [Shiki](https://github.com/shikijs/shiki) to provide syntax highlighting for [`ProsePre`](/components/prose#prosepre) and [`ProseCode`](/components/prose#prosecode).
Nuxt Content uses [Shiki](https://github.com/shikijs/shiki) to provide syntax highlighting for [`ProsePre`](/docs/components/prose#prosepre) and [`ProseCode`](/docs/components/prose#prosecode).
| Option | Type | Description |
| --------- | :------------------------------------------: | :------------------------------------------------------------------------------------------------------------------ |
Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/1.getting-started/6.migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ Here is the list breaking changes in Content v3:
- `fetchContentNavigation()`{lang=ts} API is replaced with new `queryCollectionNavigation()`{lang=ts}
- Surroundings now has its own separate API `queryCollectionItemSurroundings()`{lang=ts}
- Document driven mode is fully dropped, meaning:
- Markdown files will not convert to Nuxt pages automatically, you need to create pages, see [how](/components/content-renderer#example)
- Markdown files will not convert to Nuxt pages automatically, you need to create pages, see [how](/docs/components/content-renderer#example)
- `useContent()`{lang=ts} composable is removed
- We simplified rendering components.
- `<ContentDoc>`, `<ContentList>`, `<ContentNavigation>` and `<ContentQuery>` components are dropped in v3.
- `_dir.yml` files are renamed to `.navigation.yml`
- Multi source is dropped in favor of multi collection.
- Document `._path` is now renamed to `.path`
- `searchContent()`{lang=ts} is dropped in favor of new api `queryCollectionSearchSections`
- Full text search can easily done using this API See [Full-Text Search Snippets](/snippets/fulltext-search)
- Full text search can easily done using this API See [Full-Text Search Snippets](/docs/snippets/fulltext-search)
- `useContentHelpers()`{lang=ts} is removed


Expand Down
8 changes: 4 additions & 4 deletions docs/content/docs/2.usage/2.markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ description: 'meta description of the page'
| ------------------------------------------- | :-------: | ------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `title` | `string` | First `<h1>`{lang="html"} of the page | Title of the page, will also be injected in metas |
| `description` | `string` | First `<p>`{lang="html"} of the page | Description of the page, will be shown below the title and injected into the metas |
| `navigation` | `boolean` | `true` | Define if the page is included in [`queryCollectionNavigation`](/usage/navigation) return value. |
| `navigation` | `boolean` | `true` | Define if the page is included in [`queryCollectionNavigation`](/docs/usage/navigation) return value. |


### Excerpt
Expand Down Expand Up @@ -126,7 +126,7 @@ Example variables will be injected into the document:

Nuxt Content uses [Shiki](https://github.com/shikijs/shiki), that colors tokens with VSCode themes.

Code highlighting works both on [`ProsePre`](/components/prose#prosepre) and [`ProseCode`](/components/prose#prosecodeinline).
Code highlighting works both on [`ProsePre`](/docs/components/prose#prosepre) and [`ProseCode`](/docs/components/prose#prosecodeinline).

Each line of a code block gets its line number in the `line` attribute so lines can be labeled or individually styled.

Expand Down Expand Up @@ -170,7 +170,7 @@ Block components are components that accept Markdown content or another componen
The component must contain either:

- A `<slot />` to accept raw text or another component.
- The [`<MDCSlot />`](/components/mdc-slot) component to accept formatted text.
- The [`<MDCSlot />`](/docs/components/mdc-slot) component to accept formatted text.

In a markdown file, use the component with the **`::`** identifier.

Expand Down Expand Up @@ -561,5 +561,5 @@ If you want to customize a Prose component, here are the recommended steps:
- Make it yours 🚀.

::callout
Read the complete Prose reference in the [Prose Components section](/components/prose).
Read the complete Prose reference in the [Prose Components section](/docs/components/prose).
::
2 changes: 1 addition & 1 deletion docs/content/docs/3.composables/1.query-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function queryCollection<T extends keyof Collections>(collection: T): Collection

## Usage

Use the auto-imported `queryCollection` to find contents inside a collection.Here we assume that you havr defined `docs` collection inside `content.config.ts`. If you have not defined any collection, check [How to define a collection](/getting-started/collections#defineCollection).
Use the auto-imported `queryCollection` to find contents inside a collection.Here we assume that you havr defined `docs` collection inside `content.config.ts`. If you have not defined any collection, check [How to define a collection](/docs/getting-started/collections#defineCollection).

```vue [pages/[...slug\\].vue]
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Generate a navigation tree for the specified collection.

- Returns: A Promise that resolves to a navigation tree structure.

The navigation tree is generated based on the directory structure and ordering happens based on files [ordering](/getting-started/contents#ordering)
The navigation tree is generated based on the directory structure and ordering happens based on files [ordering](/docs/getting-started/contents#ordering)
2 changes: 1 addition & 1 deletion docs/content/docs/4.components/0.content-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: ContentRenderer
description: 'Takes your component from an AST to a wonderful template.'
---

The `<ContentRenderer>` component renders a document coming from a query with [`queryCollections()`](/api/query-collection).
The `<ContentRenderer>` component renders a document coming from a query with [`queryCollections()`](/docs/composables/query-collection).

> This component works only with `pages` collections.
Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/4.components/2.prose.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Prose component are origianlly part of [`@nuxtjs/mdc`](https://github.com/nuxt-m

::code-group
```md [Code]
[Link](/components/prose)
[Link](/docs/components/prose)
```

::preview-card{label="Preview"}
[Link](/components/prose)
[Link](/docs/components/prose)
::
::

Expand Down
22 changes: 6 additions & 16 deletions docs/content/docs/5.deploy/1.cloudflare.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
---
title: Cloudflare
description: How to deploy Nuxt Content to Cloudflare Pages.
description: How to deploy Nuxt Content to Cloudflare Pages with D1 database.
navigation:
icon: i-simple-icons-cloudflare
---

Nuxt Content uses Nuxt deployment presets to adjust the build process for different hosting platforms. To deploy your Nuxt Content to Cloudflare, you can use the `cloudflare-pages`{lang="ts-type"} preset.
Nuxt Content uses Nuxt deployment presets to adjust the build process for different hosting platforms.

You can do that in two ways:
If you use the [Cloudflare Pages GitHub/GitLab integration][1]{target="_blank"} Nuxt will detect it and use the `cloudflare-pages`{lang="ts-type"} preset automatically.

- By defining the `NITRO_PRESET`{lang="ts-type"} to `cloudflare_pages`{lang="ts-type"} when running the build process, like so:
In order to publish your project, you need to create a Cloudflare D1 database and connect it to your project.

```bash
NITRO_PRESET=cloudflare_pages npm run build
```

Or by updating your Nuxt configuration:

```bash
"preset": "cloudflare_pages",
```

If you use the [Cloudflare Pages GitHub/GitLab integration][1]{target="_blank"} Nuxt does not require configuration for presets.
[Learn how to create a D1 database](https://developers.cloudflare.com/d1/get-started/#2-create-a-database)

## Database

Unfortunately SQLite database is not supported in cloudflare environment and you should use another database.
You can simply create a D1 database in cloudflare and use Content Module's D1 adapter.

- Use [Nuxt Hub](/deploy/nuxthub) to create, connect and manage D1 database for you.
- Use [Nuxt Hub](/docs/deploy/nuxthub) to create, connect and manage D1 database for you.
- Or create a D1 database from Cloudflare dashboard and connect it to you project by creating a `wrangler.toml` file in project root. [Get started with Cloudflare D1][d1]


Expand Down

0 comments on commit 0d2c690

Please sign in to comment.