You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/content/docs/1.getting-started/1.index.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
---
2
-
navigation.title: Introduction
2
+
navigation:
3
+
title: Introduction
3
4
title: Nuxt Content v3
4
5
description: The powerful Git-based CMS designed specifically for Nuxt developers.
5
6
---
@@ -35,11 +36,11 @@ Benefits include:
35
36
36
37
The new collections system provides automatic TypeScript types for all your data. Every utility and API is strongly typed based on your collection definitions, ensuring robust type safety throughout development.
37
38
38
-
### Nuxt Studio Integration :badge[Soon]{color=neutral}
39
+
### Nuxt Studio Integration :badge[Soon]{color="neutral"}
39
40
40
41
[Nuxt Studio](/docs/studio/setup) and v3 are designed to complement each other perfectly.. The [studio module](https://github.com/nuxtlabs/studio-module) is now integrated directly into Nuxt Content, creating an ideal environment where developers can focus on code while team members manage content through an intuitive interface.
41
42
42
-
:hr
43
+
---
43
44
44
45
We're excited for you to explore these new capabilities. Dive into our documentation to learn more about integrating the module and implementing best practices in your next project.
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).
| `theme` | `ShikiTheme` or `Record<string, ShikiTheme>` | The [color theme](https://github.com/shikijs/shiki/blob/main/docs/themes.md) to use. |
145
-
| `langs` | `ShikiLang[]` | The [loaded languages](https://github.com/shikijs/shiki/blob/main/docs/languages.md) available for highlighting. |
| `theme` | `ShikiTheme` or `Record<string, ShikiTheme>` | The [color theme](https://github.com/shikijs/shiki/blob/main/docs/themes.md) to use. |
150
+
| `langs` | `ShikiLang[]` | The [loaded languages](https://github.com/shikijs/shiki/blob/main/docs/languages.md) available for highlighting. |
Copy file name to clipboardexpand all lines: docs/content/docs/1.getting-started/4.migration.md
+8-12
Original file line number
Diff line number
Diff line change
@@ -3,37 +3,35 @@ title: Migration
3
3
description: How to migrate from v2 to v3
4
4
---
5
5
6
-
Nuxt Content v3 had been rebuilt from the ground up, resulting in a new library with enhanced capabilities. While we've redesigned concepts and components in a similar way as Content v2, breaking changes are inevitable.
6
+
Nuxt Content v3 had been rebuilt from the ground up, resulting in a new library with enhanced capabilities. While we've redesigned concepts and components in a similar way as Content v2, breaking changes are inevitable.
7
7
8
8
Don't worry, you don't need to modify your content files, We made sure that Content v3 handles content in the same way as Content v2.
9
9
10
10
## Changes
11
11
12
12
Here is the list of breaking changes in Content v3:
13
13
14
-
-`queryContent()`{lang=ts} API is replaced with new `queryCollection()`{lang=ts}
14
+
-`queryContent()` API is replaced with new `queryCollection()`
15
15
- New API is backed by SQL
16
16
- New API search contents within the specific collection
17
-
-`fetchContentNavigation()`{lang=ts} API is replaced with new `queryCollectionNavigation()`{lang=ts}
18
-
- Surroundings now has its own separate API `queryCollectionItemSurroundings()`{lang=ts}
17
+
-`fetchContentNavigation()` API is replaced with new `queryCollectionNavigation()`
18
+
- Surroundings now has its own separate API `queryCollectionItemSurroundings()`
19
19
- Document driven mode is fully dropped, meaning:
20
20
- Markdown files will not convert to Nuxt pages automatically, you need to create pages, see [how](/docs/components/content-renderer#example)
21
-
-`useContent()`{lang=ts} composable is removed
21
+
-`useContent()` composable is removed
22
22
- We simplified rendering components.
23
23
-`<ContentDoc>`, `<ContentList>`, `<ContentNavigation>` and `<ContentQuery>` components are dropped in v3.
24
24
-`_dir.yml` files are renamed to `.navigation.yml`
25
25
- Multi source is dropped in favor of multi collection.
26
26
- Document `._path` is now renamed to `.path`
27
-
-`searchContent()`{lang=ts} is dropped in favor of new api `queryCollectionSearchSections`
27
+
-`searchContent()` is dropped in favor of new api `queryCollectionSearchSections`
28
28
- Full text search can easily be done using this API See [Full-Text Search Snippets](/docs/advanced/fulltext-search)
29
-
-`useContentHelpers()`{lang=ts} is removed
30
-
29
+
-`useContentHelpers()` is removed
31
30
32
31
## Implement Document Driven mode in v3
33
32
34
33
Implementing document driven mode is Content v3 is quite easy. All you need is to create a catch-all page in Nuxt and fetch contents based on route path.
Copy file name to clipboardexpand all lines: docs/content/docs/2.collections/1.collections.md
+2-3
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,17 @@
2
2
title: Define Content Collections
3
3
navigation:
4
4
title: Define
5
-
description: 'Learn how to define and configure content collections in your Nuxt application.'
5
+
description: Learn how to define and configure content collections in your Nuxt application.
6
6
---
7
7
8
-
The Nuxt Content module automatically parses any content files within the `content/` directory located at the root of your Nuxt application. This setup allows you to freely structure the folder to suit your project's needs.
8
+
The Nuxt Content module automatically parses any content files within the `content/` directory located at the root of your Nuxt application. This setup allows you to freely structure the folder to suit your project's needs.
9
9
10
10
For better organization, consider using Content Collections, which let you categorize and manage content more effectively. These collections are defined in a `content.config.ts` file.
11
11
12
12
::warning
13
13
If no `content.config.ts` file is present, all files within the content folder are parsed and imported by default. However, once a config file is added, only files matching the specified path patterns defined in collections will be imported.
14
14
::
15
15
16
-
17
16
## What are Content Collections?
18
17
19
18
Content Collections organize related items within your Nuxt Content project. They provide a structured way to manage your content, making it easier to query, display, and maintain your site's data.
@@ -103,14 +105,14 @@ The data type is useful for content that doesn’t directly correspond to a webp
103
105
With data collections, you have complete control over the schema, allowing you to define custom structures.
104
106
105
107
::note
106
-
There’s no strict relationship between collection type and file extension. For instance, a **page** collection can use [Markdown](/docs/files/markdown) or [YAML](/docs/files/yaml) or [JSON](/docs/files/json) files, and **data** collections can use any of these formats as well.
108
+
There’s no strict relationship between collection type and file extension. For instance, a **page** collection can use [Markdown](/docs/files/markdown) or [YAML](/docs/files/yaml) or [JSON](/docs/files/json) files, and **data** collections can use any of these formats as well.
107
109
::
108
110
109
111
## Ordering Files
110
112
111
113
For both types, you may want to control the display order in lists. Use numeric prefixes in file and directory names to specify an order. Nuxt Content will use these numbers when ordering content lists.
112
114
113
-
```[Directory structure]
115
+
```text [Directory structure]
114
116
content/
115
117
1.frameworks/
116
118
1.vue.md
@@ -125,4 +127,3 @@ content/
125
127
::warning
126
128
Separate number from file name using `.` character. Using any other separator will not work.
Copy file name to clipboardexpand all lines: docs/content/docs/2.collections/3.sources.md
+3-2
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ export const collections = {
23
23
The `source` property can be defined as either a string (following a glob pattern) or an object, allowing more detailed source configuration for your target directory and files within the content folder.
24
24
25
25
**Example:**
26
+
26
27
-`source: '**` includes all files within the content directory and its subdirectories.
27
28
-`source: '**/*.md'`includes all `Markdown` files within the content directory and its subdirectories.
28
29
-`source: 'docs/**/*.yml'` includes all `YML` files within the `content/docs` and its subdirectories.
@@ -41,15 +42,15 @@ Glob patterns to exclude content from the import.
41
42
42
43
This configuration only applied for **page** type with 1-to-1 relationship between content files and pages on your site.
43
44
44
-
It represents the path prefix (base URL) of the corresponding page on the website.
45
+
It represents the path prefix (base URL) of the corresponding page on the website.
45
46
46
47
### `cwd`
47
48
48
49
Root directory for content matching.
49
50
50
51
### `repository`
51
52
52
-
External source representing a remote git repository URL (e.g., https://github.com/nuxt/content)
53
+
External source representing a remote git repository URL (e.g., <https://github.com/nuxt/content>)
0 commit comments