Skip to content

Commit 189311e

Browse files
authored
Merge pull request #1843 from nuxt/main
v2.4.0
2 parents 3c9fc3f + 41e3ea8 commit 189311e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4273
-2945
lines changed

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![npm version][npm-version-src]][npm-version-href]
44
[![npm downloads][npm-downloads-src]][npm-downloads-href]
55
[![License][license-src]][license-href]
6+
[![Volta][volta-src]][volta-href]
67

78
# Nuxt Content
89

@@ -41,12 +42,15 @@ Nuxt 2 is supported with Content v1, documentation is on https://content.nuxtjs.
4142
[MIT](./LICENSE) - Made with 💚
4243

4344

44-
[npm-version-src]: https://img.shields.io/npm/v/@nuxt/content/latest.svg?style=flat&colorA=002438&colorB=28CF8D
45+
[npm-version-src]: https://img.shields.io/npm/v/@nuxt/content/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
4546
[npm-version-href]: https://npmjs.com/package/@nuxt/content
4647

47-
[npm-downloads-src]: https://img.shields.io/npm/dt/@nuxt/content.svg?style=flat&colorA=002438&colorB=28CF8D
48+
[npm-downloads-src]: https://img.shields.io/npm/dt/@nuxt/content.svg?style=flat&colorA=18181B&colorB=28CF8D
4849
[npm-downloads-href]: https://npmjs.com/package/@nuxt/content
4950

50-
[license-src]: https://img.shields.io/github/license/nuxt/content.svg?style=flat&colorA=002438&colorB=28CF8D
51+
[license-src]: https://img.shields.io/github/license/nuxt/content.svg?style=flat&colorA=18181B&colorB=28CF8D
5152
[license-href]: https://github.com/nuxt/content/blob/main/LICENSE
5253

54+
55+
[volta-src]: https://user-images.githubusercontent.com/904724/209143798-32345f6c-3cf8-4e06-9659-f4ace4a6acde.svg
56+
[volta-href]: https://volta.net/nuxt/content?utm_source=readme_nuxt_content

docs/app.config.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ export default defineAppConfig({
1717
github: {
1818
root: 'docs/content',
1919
edit: true,
20-
releases: true
20+
releases: true,
21+
owner: 'nuxt',
22+
repo: 'content',
23+
branch: 'main'
2124
},
2225
cover: {
2326
src: '/cover.jpg',

docs/components/content/Logo.vue

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
<template>
2-
<svg height="24px" viewBox="0 0 126 24" fill="none" xmlns="http://www.w3.org/2000/svg">
3-
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.6009 1.34267c-.9666-1.65485-3.3832-1.65485-4.3499 0L.71619 19.3781c-.96664 1.6549.24165 3.7234 2.17494 3.7234h8.22407c-.8261-.7188-1.13199-1.9623-.5068-3.0293L18.587 6.45475l-2.9861-5.11208Z" fill="#80EEC0" />
4-
<path d="M22.276 5.29879c.8-1.35398 2.7999-1.35398 3.5999 0L34.5944 20.055c.8 1.354-.2 3.0465-1.7999 3.0465h-17.437c-1.5999 0-2.6-1.6925-1.8-3.0465L22.276 5.29879Z" fill="#00DC82" />
5-
<path d="M49.5744 23.0432c3.8655 0 6.7421-2.2261 7.0567-5.4866h-2.9665c-.2697 1.7089-1.9327 2.9007-4.0902 2.9007-2.7418 0-4.8094-1.8888-4.8094-5.4641 0-3.5753 2.0676-5.48663 4.8094-5.48663 2.1125 0 3.7756 1.19173 4.0003 2.92323h3.1014c-.427-3.26053-3.3036-5.48664-7.1017-5.48664-4.1127 0-7.7984 2.6983-7.7984 8.05004 0 5.3517 3.6183 8.05 7.7984 8.05Zm14.2834 0c3.4385 0 5.9104-2.4735 5.9104-5.8464s-2.4719-5.8464-5.9104-5.8464c-3.461 0-5.9329 2.4735-5.9329 5.8464s2.4719 5.8464 5.9329 5.8464Zm0-2.3836c-1.8878 0-3.1464-1.4166-3.1464-3.4628 0-2.0463 1.2586-3.4628 3.1464-3.4628 1.8653 0 3.124 1.4165 3.124 3.4628 0 2.0462-1.2587 3.4628-3.124 3.4628Zm10.5403 2.2037v-6.1837c0-1.664 1.0787-2.8782 2.6295-2.8782 1.4156 0 2.3598 1.0794 2.3598 2.6309v6.431h2.764v-7.0157c0-2.6533-1.6629-4.4972-4.2251-4.4972-1.618 0-2.8991.6971-3.5282 1.9338v-1.7539h-2.764v11.333h2.764Zm11.2487-11.333h-2.2252v2.3161h2.2252v5.0594c0 2.5184 1.6181 3.9575 4.09 3.9575h1.8205v-2.3386h-1.506c-1.0332 0-1.6404-.5846-1.6404-1.7314v-4.9469h3.1464v-2.3161h-3.1464V8.11242h-2.7641v3.41788Zm15.2492 7.5553c-.292 1.0793-1.2134 1.664-2.629 1.664-1.7532 0-2.9216-1.1693-3.124-2.9906h8.36c.023-.2249.045-.5622.045-.9445 0-2.6983-1.707-5.4641-5.5059-5.4641-3.7082 0-5.551 2.8108-5.551 5.8014 0 2.9682 2.0677 5.8914 5.7759 5.8914 2.787 0 4.899-1.5516 5.326-3.9576h-2.697Zm-2.8539-5.6664c1.6405 0 2.6299 1.0793 2.7419 2.5184h-5.5732c.2921-1.709 1.2805-2.5184 2.8313-2.5184Zm10.1759 9.4441v-6.1837c0-1.664 1.079-2.8782 2.63-2.8782 1.416 0 2.36 1.0794 2.36 2.6309v6.431h2.764v-7.0157c0-2.6533-1.663-4.4972-4.225-4.4972-1.618 0-2.899.6971-3.529 1.9338v-1.7539h-2.764v11.333h2.764Zm11.249-11.333h-2.225v2.3161h2.225v5.0594c0 2.5184 1.618 3.9575 4.09 3.9575h1.821v-2.3386h-1.506c-1.034 0-1.641-.5846-1.641-1.7314v-4.9469h3.147v-2.3161h-3.147V8.11242h-2.764v3.41788Z" fill="currentColor" />
2+
<svg
3+
height="24px"
4+
viewBox="0 0 126 24"
5+
fill="none"
6+
xmlns="http://www.w3.org/2000/svg"
7+
>
8+
<path
9+
fill="#00DC82"
10+
d="M19.8732 23.567h13.1686c.4183.0001.8292-.1069 1.1914-.3101.3622-.2033.6629-.4956.872-.8476.209-.352.319-.7513.3188-1.1577-.0002-.4064-.1105-.8056-.3198-1.1574L26.2605 5.21014c-.209-.35193-.5097-.64418-.8719-.84737-.3621-.2032-.7729-.31017-1.1911-.31017s-.829.10697-1.1912.31017c-.3621.20319-.6628.49544-.8718.84737l-2.2613 3.80829-4.4212-7.44699c-.2092-.3519-.51-.64411-.8723-.84727-.3622-.20316-.7731-.3101-1.1913-.3101-.4183 0-.8292.10694-1.1914.3101-.3623.20316-.6631.49537-.8723.84727L.31986 20.0942C.1105 20.446.00018 20.8452 0 21.2516c-.00018.4064.10978.8057.31882 1.1577.20905.352.5098.6443.87202.8476.36221.2032.77312.3102 1.19138.3101h8.26618c3.2751 0 5.6904-1.3979 7.3524-4.125l4.0349-6.7899 2.1611-3.63367L30.683 19.9333h-8.6473l-2.1625 3.6337Zm-9.3596-3.6374-5.7687-.0013 8.6473-14.55231 4.3147 7.27611-2.8889 4.8633c-1.1037 1.7695-2.3575 2.4142-4.3044 2.4142Z"
11+
/>
12+
<path
13+
d="M49.5744 23.0432c3.8655 0 6.7421-2.2261 7.0567-5.4866h-2.9665c-.2697 1.7089-1.9327 2.9007-4.0902 2.9007-2.7418 0-4.8094-1.8888-4.8094-5.4641 0-3.5753 2.0676-5.48663 4.8094-5.48663 2.1125 0 3.7756 1.19173 4.0003 2.92323h3.1014c-.427-3.26053-3.3036-5.48664-7.1017-5.48664-4.1127 0-7.7984 2.6983-7.7984 8.05004 0 5.3517 3.6183 8.05 7.7984 8.05Zm14.2834 0c3.4385 0 5.9104-2.4735 5.9104-5.8464s-2.4719-5.8464-5.9104-5.8464c-3.461 0-5.9329 2.4735-5.9329 5.8464s2.4719 5.8464 5.9329 5.8464Zm0-2.3836c-1.8878 0-3.1464-1.4166-3.1464-3.4628 0-2.0463 1.2586-3.4628 3.1464-3.4628 1.8653 0 3.124 1.4165 3.124 3.4628 0 2.0462-1.2587 3.4628-3.124 3.4628Zm10.5403 2.2037v-6.1837c0-1.664 1.0787-2.8782 2.6295-2.8782 1.4156 0 2.3598 1.0794 2.3598 2.6309v6.431h2.764v-7.0157c0-2.6533-1.6629-4.4972-4.2251-4.4972-1.618 0-2.8991.6971-3.5282 1.9338v-1.7539h-2.764v11.333h2.764Zm11.2487-11.333h-2.2252v2.3161h2.2252v5.0594c0 2.5184 1.6181 3.9575 4.09 3.9575h1.8205v-2.3386h-1.506c-1.0332 0-1.6404-.5846-1.6404-1.7314v-4.9469h3.1464v-2.3161h-3.1464V8.11242h-2.7641v3.41788Zm15.2492 7.5553c-.292 1.0793-1.2134 1.664-2.629 1.664-1.7532 0-2.9216-1.1693-3.124-2.9906h8.36c.023-.2249.045-.5622.045-.9445 0-2.6983-1.707-5.4641-5.5059-5.4641-3.7082 0-5.551 2.8108-5.551 5.8014 0 2.9682 2.0677 5.8914 5.7759 5.8914 2.787 0 4.899-1.5516 5.326-3.9576h-2.697Zm-2.8539-5.6664c1.6405 0 2.6299 1.0793 2.7419 2.5184h-5.5732c.2921-1.709 1.2805-2.5184 2.8313-2.5184Zm10.1759 9.4441v-6.1837c0-1.664 1.079-2.8782 2.63-2.8782 1.416 0 2.36 1.0794 2.36 2.6309v6.431h2.764v-7.0157c0-2.6533-1.663-4.4972-4.225-4.4972-1.618 0-2.899.6971-3.529 1.9338v-1.7539h-2.764v11.333h2.764Zm11.249-11.333h-2.225v2.3161h2.225v5.0594c0 2.5184 1.618 3.9575 4.09 3.9575h1.821v-2.3386h-1.506c-1.034 0-1.641-.5846-1.641-1.7314v-4.9469h3.147v-2.3161h-3.147V8.11242h-2.764v3.41788Z"
14+
fill="currentColor"
15+
/>
616
</svg>
717
</template>

docs/content/2.get-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can start playing with Nuxt Content in your browser using our online sandbox
2222
Before getting started, please **make sure to have installed the recommended setup**:
2323

2424
#content
25-
* Follow the [Nuxt 3 Prerequisites](https://v3.nuxtjs.org/getting-started/quick-start#prerequisites)
25+
* Follow the [Nuxt 3 Prerequisites](https://nuxt.com/docs/getting-started/installation#prerequisites)
2626

2727
* Download the [VS Code **MDC Extension**](https://marketplace.visualstudio.com/items?itemName=Nuxt.mdc)
2828
::

docs/content/3.guide/1.writing/2.markdown.md

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Full amount of content beyond the more divider.
8787

8888
Description property will contain the excerpt content unless defined within the Front Matter props.
8989

90+
If there is no `<!--more-->` divider in the text then excerpt is undefined.
91+
9092
Example variables will be injected into the document:
9193

9294
```json

docs/content/3.guide/2.displaying/1.rendering.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Head over to the [API section](/api/components/content-doc) to see the complete
4949

5050
## `<ContentRenderer />`
5151

52-
The `<ContentRenderer>` component renders the body of a Markdown document returned by [`queryContent()`](/guide/displaying/querying) in a rich-text format. It fallbacks to rendering the content in a `<pre>`{lang="html"} tag if the content is not Markdown ([:icon{name="fa-brands:github" class="inline-block w-4"} source code](https://github.com/nuxt/content/blob/main/src/runtime/components/ContentRenderer.ts)).
52+
The `<ContentRenderer>` component renders the body of a Markdown document returned by [`queryContent()`](/guide/displaying/querying) in a rich-text format. It fallbacks to rendering the content in a `<pre>`{lang="html"} tag if the content is not Markdown ([:icon{name="fa-brands:github" class="inline-block w-4"} source code](https://github.com/nuxt/content/blob/main/src/runtime/components/ContentRenderer.vue)).
5353

5454
`<ContentRenderer>` accepts a `value` prop containing the data.
5555

docs/content/3.guide/3.recipes/1.sitemap.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This can be created by utilising the `sitemap` library, which can be installed a
1818

1919
## Server Route
2020

21-
We will be utilising the [server routes](https://v3.nuxtjs.org/guide/features/server-routes) available within Nuxt, and to do so you'll need to create the `server/` directory within your website's root directly.
21+
We will be utilising the [server routes](https://nuxt.com/docs/guide/directory-structure/server#server-routes) available within Nuxt, and to do so you'll need to create the `server/` directory within your website's root directly.
2222

2323
Once this is done, create a `routes/` directory inside this, and add a `sitemap.xml.ts` file, this will translate to `/sitemap.xml`.
2424

docs/content/3.guide/4.deploy/1.node-server.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Generated files are ready-to-run on Node environment.
1212
node .output/server/index.mjs
1313
```
1414

15-
Read more about [Node Server deploy](https://v3.nuxtjs.org/guide/deploy/node-server) on Nuxt official docs.
15+
Read more about [Node Server deploy](https://nuxt.com/docs/getting-started/deployment#nodejs-server) on Nuxt official docs.

docs/content/4.api/1.components/2.content-list.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ An explicit `path`{lang=ts} can be given to the component.
3939
```html [pages/index.vue]
4040
<template>
4141
<main>
42-
<ContentList path="/articles" v-slot="{ list }">
43-
<!-- ...default slot -->
42+
<ContentList path="/articles">
43+
<template v-slot="{ list }">
44+
<!-- ...default slot -->
45+
</template>
4446
<template #not-found>
4547
<p>No articles found.</p>
4648
</template>

docs/content/4.api/1.components/7.prose.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ To overwrite a prose component, create a component with the same name in your pr
4545
::code-group
4646

4747
```markdown [Code]
48-
```javascript
48+
```javascript[file.js]{4-6,7} meta-info=val
4949
export default () => {
5050
console.log('Code block')
5151
}
@@ -54,7 +54,7 @@ To overwrite a prose component, create a component with the same name in your pr
5454

5555
::code-block{label="Preview"}
5656

57-
```javascript
57+
```javascript[file.js]{4-6,7}
5858
export default () => {
5959
console.log('Code block')
6060
}
@@ -64,6 +64,17 @@ To overwrite a prose component, create a component with the same name in your pr
6464

6565
::
6666

67+
Component properties will be:
68+
```json
69+
{
70+
code: "export default () => {\n console.log('Code block')\n}"
71+
language: "javascript"
72+
filename: "file.js"
73+
highlights: [4, 5, 6, 7]
74+
meta: "meta-info=val"
75+
}
76+
```
77+
6778
Check out the [highlight options](/api/configuration#highlight) for more about the syntax highlighting.
6879

6980
## `ProseCodeInline`

docs/content/4.api/4.advanced.md

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ import MyModule from './my-module'
130130

131131
export default defineNuxtConfig({
132132
modules: [
133+
// always put it before @nuxt/content because the transformers
134+
// needs to be loaded before transformation occurs
133135
MyModule,
134136
'@nuxt/content'
135137
]

docs/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"generate": "nuxi generate"
1010
},
1111
"devDependencies": {
12-
"@nuxt-themes/docus": "^1.1.5",
13-
"@nuxthq/studio": "^0.3.5",
14-
"@nuxtlabs/github-module": "^1.5.4",
12+
"@docsearch/js": "^3.3.2",
13+
"@nuxt-themes/docus": "^1.6.0",
14+
"@nuxthq/studio": "^0.6.5",
15+
"@nuxtlabs/github-module": "^1.6.1",
1516
"monaco-editor-core": "^0.34.1",
16-
"nuxt": "v3.0.0",
17+
"nuxt": "3.1.0",
1718
"vue-plausible": "^1.3.2"
1819
}
1920
}

docs/public/favicon.ico

-101 KB
Binary file not shown.

0 commit comments

Comments
 (0)