Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.8 #2264

Merged
merged 36 commits into from
Aug 29, 2023
Merged

v2.8 #2264

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
beaa64f
feat: add count method (#1924)
Barbapapazes Jul 25, 2023
3e62155
docs: pre-render pages (#2196)
farnabaz Jul 26, 2023
b675446
feat(nuxt-mdc): extract markdown parser (#2187)
farnabaz Jul 26, 2023
d81a08a
fix: markdown render compatiblity
farnabaz Jul 26, 2023
1fef213
chore: upgrade `nuxt-mdc`
farnabaz Jul 27, 2023
85fdb08
docs(v1): link button wrapping for small screens (#2199)
nobkd Jul 28, 2023
d3ad72d
chore(deps): update all non-major dependencies (#2181)
renovate[bot] Jul 31, 2023
d589e04
docs: add count method (#2200)
Barbapapazes Aug 1, 2023
c582469
docs: add edge alert
farnabaz Aug 1, 2023
9c2f3be
feat: advanced query schema (#2213)
farnabaz Aug 3, 2023
e23027f
chore(deps): update all non-major dependencies (#2209)
renovate[bot] Aug 4, 2023
efc6048
fix(slot): rename ContentSlot to MDCSlot in render function
farnabaz Aug 9, 2023
4c88eae
chore(deps): update all non-major dependencies (#2218)
renovate[bot] Aug 9, 2023
7558cf0
fix(module): slot transform sourcemap
farnabaz Aug 10, 2023
a7e308a
chore: update social card
Atinux Aug 11, 2023
2e5c7f7
docs: Update README.md (#2226)
maximepvrt Aug 12, 2023
71ed34f
docs(mdc): fix `{attribute}` examples (#2228)
nobkd Aug 23, 2023
2745604
fix(ProseImg): prevent conflict between `src` and baseURL (#2242)
farnabaz Aug 23, 2023
cf3e927
chore: upgrade deps
farnabaz Aug 23, 2023
978cd46
chore(deps): lock file maintenance (#2192)
renovate[bot] Aug 23, 2023
89862d7
feat: allow to disable content head (#2142)
Barbapapazes Aug 23, 2023
06afe69
chore(deps): update all non-major dependencies (#2243)
renovate[bot] Aug 23, 2023
3db06b2
chore: upgrade `nuxt-mdc`
farnabaz Aug 24, 2023
b32562e
docs: add warning for `<NuxtPage/>` existence in `app.vue` (#2244)
mdartic Aug 24, 2023
5002a37
fix: Custom drivers failed on build (#2193)
shareable-vision Aug 24, 2023
aea5e58
fix(ContentRenderer): render contents only with excerpt (#2246)
farnabaz Aug 24, 2023
5169f3d
chore(deps): update all non-major dependencies (#2247)
renovate[bot] Aug 25, 2023
0bfc275
docs: `<ContentDoc>` slot example
farnabaz Aug 25, 2023
7edfaa1
chore: update to micromark v4 (#2253)
cexbrayat Aug 26, 2023
aa61d9f
docs: fix prose links
farnabaz Aug 27, 2023
ba4d011
chore: use `@nuxtjs/mdc`
farnabaz Aug 28, 2023
9720a33
docs: update prose source links
farnabaz Aug 28, 2023
ff11497
chore(deps): update all non-major dependencies (#2250)
renovate[bot] Aug 29, 2023
329cf3b
fix(content-slot): better slot name regex
farnabaz Aug 29, 2023
0fdcc51
chore(deps): upgrade to `@nuxtjs/mdc@0.1.2`
farnabaz Aug 29, 2023
8d4a479
chore(release): release v2.8.0
farnabaz Aug 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '16'
- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v2.4.0
name: Install pnpm
id: pnpm-install
with:
Expand Down
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,60 @@
# Changelog


## v2.8.0

[compare changes](https://github.com/nuxt/content/compare/v2.7.2...v2.8.0)

### 🚀 Enhancements

- Add count method ([#1924](https://github.com/nuxt/content/pull/1924))
- **nuxt-mdc:** Extract markdown parser ([#2187](https://github.com/nuxt/content/pull/2187))
- Advanced query schema ([#2213](https://github.com/nuxt/content/pull/2213))
- Allow to disable content head ([#2142](https://github.com/nuxt/content/pull/2142))

### 🩹 Fixes

- Markdown render compatiblity ([d81a08a2](https://github.com/nuxt/content/commit/d81a08a2))
- **slot:** Rename ContentSlot to MDCSlot in render function ([efc60481](https://github.com/nuxt/content/commit/efc60481))
- **module:** Slot transform sourcemap ([7558cf0d](https://github.com/nuxt/content/commit/7558cf0d))
- **ProseImg:** Prevent conflict between `src` and baseURL ([#2242](https://github.com/nuxt/content/pull/2242))
- Custom drivers failed on build ([#2193](https://github.com/nuxt/content/pull/2193))
- **ContentRenderer:** Render contents only with excerpt ([#2246](https://github.com/nuxt/content/pull/2246))
- **content-slot:** Better slot name regex ([329cf3bc](https://github.com/nuxt/content/commit/329cf3bc))

### 📖 Documentation

- Pre-render pages ([#2196](https://github.com/nuxt/content/pull/2196))
- **v1:** Link button wrapping for small screens ([#2199](https://github.com/nuxt/content/pull/2199))
- Add count method ([#2200](https://github.com/nuxt/content/pull/2200))
- Add edge alert ([c582469c](https://github.com/nuxt/content/commit/c582469c))
- Update README.md ([#2226](https://github.com/nuxt/content/pull/2226))
- **mdc:** Fix `{attribute}` examples ([#2228](https://github.com/nuxt/content/pull/2228))
- Add warning for `<NuxtPage/>` existence in `app.vue` ([#2244](https://github.com/nuxt/content/pull/2244))
- `<ContentDoc>` slot example ([0bfc275d](https://github.com/nuxt/content/commit/0bfc275d))
- Fix prose links ([aa61d9fd](https://github.com/nuxt/content/commit/aa61d9fd))
- Update prose source links ([9720a333](https://github.com/nuxt/content/commit/9720a333))

### 🏡 Chore

- Upgrade `nuxt-mdc` ([1fef2137](https://github.com/nuxt/content/commit/1fef2137))
- Update social card ([a7e308ae](https://github.com/nuxt/content/commit/a7e308ae))
- Upgrade deps ([cf3e927c](https://github.com/nuxt/content/commit/cf3e927c))
- Upgrade `nuxt-mdc` ([3db06b23](https://github.com/nuxt/content/commit/3db06b23))
- Update to micromark v4 ([#2253](https://github.com/nuxt/content/pull/2253))
- Use `@nuxtjs/mdc` ([ba4d0118](https://github.com/nuxt/content/commit/ba4d0118))

### ❤️ Contributors

- Farnabaz <farnabaz@gmail.com>
- Cédric Exbrayat
- Yarrow
- Mathieu DARTIGUES ([@mdartic](http://github.com/mdartic))
- Estéban <e.soubiran25@gmail.com>
- Nobkd
- Maxime Pauvert ([@maximepvrt](http://github.com/maximepvrt))
- Sébastien Chopin ([@Atinux](http://github.com/Atinux))

## v2.7.2

[compare changes](https://github.com/nuxt/content/compare/v2.7.1...v2.7.2)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![nuxt-content](https://user-images.githubusercontent.com/904724/221176888-d9efefbe-0a8a-4d6b-beb2-5cc7d7dcad05.png)](https://content.nuxtjs.org)
[![nuxt-content-social-card](https://github.com/nuxt/content/assets/904724/1cedd2ef-94fc-4210-aa84-5ab0dc449228)](https://content.nuxtjs.org)

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
Expand Down Expand Up @@ -37,7 +37,7 @@ Nuxt 2 is supported with Content v1, documentation is on <https://content.nuxtjs
- Clone repository
- Install dependencies using `pnpm install`
- Prepare using `pnpm prepare`
- Prepare using `pnpm build`
- Build using `pnpm build`
- Try playground using `pnpm dev`
- Test using `pnpm test`

Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/ChangeLog.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<GithubReleases v-slot="{releases}">
<GithubReleases v-slot="{ releases }">
<div v-for="release in releases" :key="release.name" class="release">
<div class="release-name">
<h2 class="">
Expand Down
8 changes: 6 additions & 2 deletions docs/components/content/V1DocsLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
<button-link href="/v1/getting-started/introduction" :transparent="true" color="false" size="large">
English
</button-link>
<button-link href="/fr/v1/getting-started/introduction" :transparent="true" color="false" class="ml-2" size="large">
<button-link href="/fr/v1/getting-started/introduction" :transparent="true" color="false" size="large">
French
</button-link>
<button-link href="/ja/v1/getting-started/introduction" :transparent="true" color="false" class="ml-2" size="large">
<button-link href="/ja/v1/getting-started/introduction" :transparent="true" color="false" size="large">
Japanese
</button-link>
<button-link href="/ru/v1/getting-started/introduction" :transparent="true" color="false" size="large">
Russian
</button-link>
</div>
<ellipsis />
</div>
Expand All @@ -34,6 +37,7 @@ css({
},
'.links-wrapper': {
display: 'flex',
flexWrap: 'wrap',
gap: '2rem',
justifyContent: 'center'
},
Expand Down
20 changes: 10 additions & 10 deletions docs/content-v1/en/1.getting-started/3.writing.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The `createdAt` and `updatedAt` properties are based on the file's actual create

This module converts your `.md` files into a JSON AST tree structure, stored in a `body` variable.

Make sure to use the `<nuxt-content>` component to display the `body` of your markdown content, see [displaying content](/displaying).
Make sure to use the `<nuxt-content>` component to display the `body` of your markdown content, see [displaying content](/v1/getting-started/displaying).

> You can check the [basic syntax guide](https://www.markdownguide.org/basic-syntax) to help you master Markdown

Expand Down Expand Up @@ -133,7 +133,7 @@ It will be transformed to its JSON AST structure, and by using the `nuxt-content

### Links

Links are transformed to add valid `target` and `rel` attributes using [remark-external-links](https://github.com/remarkjs/remark-external-links). You can check [here](/configuration#markdown) to learn how to configure this plugin.
Links are transformed to add valid `target` and `rel` attributes using [remark-external-links](https://github.com/remarkjs/remark-external-links). You can check [here](/v1/getting-started/configuration#markdown) to learn how to configure this plugin.

Relative links are also automatically transformed to [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/) to provide navigation between page components with enhanced performance through smart prefetching.

Expand All @@ -159,7 +159,7 @@ title: Home

### Footnotes

This module supports extended markdown syntax for footnotes using [remark-footnotes](https://github.com/remarkjs/remark-footnotes). You can check [here](/configuration#markdown) to learn how to configure this plugin.
This module supports extended markdown syntax for footnotes using [remark-footnotes](https://github.com/remarkjs/remark-footnotes). You can check [here](/v1/getting-started/configuration#markdown) to learn how to configure this plugin.

Here is an example using footnotes:

Expand All @@ -181,7 +181,7 @@ Here's a simple footnote,[^1] and here's a longer one.[^bignote]

### Codeblocks

This module automatically wraps codeblocks and applies [PrismJS](https://prismjs.com) classes (see [syntax highlighting](/writing#syntax-highlighting)).
This module automatically wraps codeblocks and applies [PrismJS](https://prismjs.com) classes (see [syntax highlighting](/v1/getting-started/writing#syntax-highlighting)).

Codeblocks in Markdown are wrapped inside 3 backticks. Optionally, you can define the language of the codeblock to enable specific syntax highlighting.

Expand Down Expand Up @@ -226,7 +226,7 @@ Filename will be converted to a span with a `filename` class. It's up to you to

### Syntax highlighting

It supports by default code highlighting using [PrismJS](https://prismjs.com) and injects the theme defined in options into your Nuxt.js app, see [configuration](/configuration#markdownprismtheme).
It supports by default code highlighting using [PrismJS](https://prismjs.com) and injects the theme defined in options into your Nuxt.js app, see [configuration](/v1/getting-started/configuration#markdownprismtheme).

### HTML

Expand Down Expand Up @@ -274,7 +274,7 @@ You can use global Vue components or locally registered in the page you're displ

<alert type="warning">

An issue exists with locally registered components and live edit in development, since **v1.5.0** you can disable it by setting `liveEdit: false` (see [configuration](/configuration#liveedit)).
An issue exists with locally registered components and live edit in development, since **v1.5.0** you can disable it by setting `liveEdit: false` (see [configuration](/v1/getting-started/configuration#liveedit)).

</alert>

Expand Down Expand Up @@ -338,7 +338,7 @@ multiselectOptions:

<alert type="info">

These components will be rendered using the `<nuxt-content>` component, see [displaying content](/displaying#component).
These components will be rendered using the `<nuxt-content>` component, see [displaying content](/v1/getting-started/displaying#component).

</alert>

Expand Down Expand Up @@ -399,7 +399,7 @@ When fetching a document, we have access to a toc property which is an array of

<alert type="info">

Check out [this snippet](/snippets#table-of-contents) on how to implement a table of contents into your app
Check out [this snippet](/v1/community/snippets#table-of-contents) on how to implement a table of contents into your app

</alert>

Expand Down Expand Up @@ -474,7 +474,7 @@ Will be transformed into:
}
```

We internally add a `text` key with the markdown body that will be used for [searching](/fetching#searchfield-value) or [extending](/advanced#contentfilebeforeinsert) it.
We internally add a `text` key with the markdown body that will be used for [searching](/v1/getting-started/fetching#searchfield-value) or [extending](/v1/getting-started/advanced#contentfilebeforeinsert) it.

## JSON / JSON5

Expand All @@ -486,7 +486,7 @@ Data defined will be injected into the document.

<badge>v0.10.0+</badge>

You can now use arrays inside your `.json` files. Objects will be flattened and inserted into the collection. You can [fetch](/fetching) your content in the same way as your used to.
You can now use arrays inside your `.json` files. Objects will be flattened and inserted into the collection. You can [fetch](/v1/getting-started/fetching) your content in the same way as your used to.

<alert type="warning">

Expand Down
12 changes: 6 additions & 6 deletions docs/content-v1/en/1.getting-started/4.fetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const articles = await this.$content('articles').where({ age: { $gt: 18 } }).fet
const articles = await this.$content('articles').where({ name: { $in: ['odin', 'thor'] } }).fetch()
```

In order to filter in objects and array you need to enable nestedProperties, see [configuration](/configuration#nestedproperties).
In order to filter in objects and array you need to enable nestedProperties, see [configuration](/v1/getting-started/configuration#nestedproperties).

```js
const products = await this.$content('products').where({ 'categories.slug': { $contains: 'top' } }).fetch()
Expand Down Expand Up @@ -112,7 +112,7 @@ const articles = await this.$content('articles').sortBy('title').fetch()

`sortBy` method does **case-sensitive** sort, which is currently not configurable.

If you need case-insensitive sorting, check out [this snippet](/snippets#case-insensitive-sorting) on how to work around it.
If you need case-insensitive sorting, check out [this snippet](/v1/community/snippets#case-insensitive-sorting) on how to work around it.

</alert>

Expand Down Expand Up @@ -152,7 +152,7 @@ const articles = await this.$content('articles').skip(5).limit(5).fetch()

Performs a full-text search on a field. `value` is optional, in this case `field` is the `value` and search will be performed on all defined full-text search fields.

The fields you want to search on must be defined in options in order to be indexed, see [configuration](/configuration#fulltextsearchfields).
The fields you want to search on must be defined in options in order to be indexed, see [configuration](/v1/getting-started/configuration#fulltextsearchfields).

Using an empty string as parameter will skip the search.

Expand All @@ -167,7 +167,7 @@ const articles = await this.$content('articles').search('').fetch()

<alert type="info">

Check out [this snippet](/snippets#search) on how to implement search into your app
Check out [this snippet](/v1/community/snippets#search) on how to implement search into your app

</alert>

Expand Down Expand Up @@ -212,7 +212,7 @@ Getting results based on `path` is only supported since v1.12.0

<alert type="info">

Check out [this snippet](/snippets#prev-and-next) on how to implement prev and next links into your app
Check out [this snippet](/v1/community/snippets#prev-and-next) on how to implement prev and next links into your app

</alert>

Expand Down Expand Up @@ -249,4 +249,4 @@ const articles = await this.$content('articles')
})
```

> You can check how to use the [Content API](/advanced#api-endpoint) in development.
> You can check how to use the [Content API](/v1/getting-started/advanced#api-endpoint) in development.
4 changes: 2 additions & 2 deletions docs/content-v1/en/1.getting-started/5.displaying.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export default {
- tag:
- Type: `string`

Learn more about what you can write in your markdown file in the [writing content](/writing#markdown) section.
Learn more about what you can write in your markdown file in the [writing content](/v1/getting-started/writing#markdown) section.

### Excerpt

If you are utilizing the [excerpt](/writing#excerpt) feature, you can display the content of your excerpt using the following model:
If you are utilizing the [excerpt](/v1/getting-started/writing#excerpt) feature, you can display the content of your excerpt using the following model:

```vue
<template>
Expand Down
4 changes: 2 additions & 2 deletions docs/content-v1/en/1.getting-started/6.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ content: {
- Type: `Array`
- Default: `['title', 'description', 'slug', 'text']`

Fields that needs to be indexed to be searchable, learn more about search [here](/fetching#searchfield-value).
Fields that needs to be indexed to be searchable, learn more about search [here](/v1/getting-started/fetching#searchfield-value).

`text` is a special key that contains your Markdown before being parsed to AST.

Expand Down Expand Up @@ -431,7 +431,7 @@ export default {
}
```

> You can head over to [Snippets - Custom Highlighter](/snippets#custom-highlighter) section to see more example.
> You can head over to [Snippets - Custom Highlighter](/v1/community/snippets#custom-highlighter) section to see more example.

### `yaml`

Expand Down
8 changes: 4 additions & 4 deletions docs/content-v1/en/1.getting-started/7.advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Arguments:
- `document`
- Type: `object`
- Properties:
- See [writing content](/writing)
- See [writing content](/v1/getting-started/writing)
- `database`
- Type: `object`
- Properties:
Expand Down Expand Up @@ -157,7 +157,7 @@ Arguments:
- `options`
- Type: `object`
- Properties:
- See [configuration](/configuration#properties)
- See [configuration](/v1/getting-started/configuration#properties)

**Example**

Expand Down Expand Up @@ -213,7 +213,7 @@ This documentation uses it actually. You can learn more by looking at [plugins/i

## API Endpoint

This module exposes an API endpoint in development so you can easily see the JSON of each directory or file, it is available on [http://localhost:3000/_content/](http://localhost:3000/_content/). The prefix is `_content` by default and can be configured with the [apiPrefix](/configuration#apiprefix) property.
This module exposes an API endpoint in development so you can easily see the JSON of each directory or file, it is available on [http://localhost:3000/_content/](http://localhost:3000/_content/). The prefix is `_content` by default and can be configured with the [apiPrefix](/v1/getting-started/configuration#apiprefix) property.

**Example**

Expand Down Expand Up @@ -246,7 +246,7 @@ Since **v1.4.0**, this endpoint also supports `where` in query params:

> This module uses LokiJS under the hood. You can check here for [query examples](https://github.com/techfort/LokiJS/wiki/Query-Examples#find-queries).

- You can use [nested properties](/configuration#nestedproperties):
- You can use [nested properties](/v1/getting-started/configuration#nestedproperties):

`http://localhost:3000/_content/products?categories.slug_contains=top`

Expand Down
8 changes: 4 additions & 4 deletions docs/content-v1/en/3.community/1.snippets.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
</script>
```

> Check out the [search documentation](/fetching#searchfield-value)
> Check out the [search documentation](/v1/getting-started/fetching#searchfield-value)

### Prev and Next

Expand Down Expand Up @@ -145,7 +145,7 @@ even when the current page is showing the higer-positioned document.

</alert>

> Check out the [surround documentation](/fetching#surroundslugorpath-options)
> Check out the [surround documentation](/v1/getting-started/fetching#surroundslugorpath-options)

### Case-Insensitive Sorting

Expand Down Expand Up @@ -185,7 +185,7 @@ export default {
}
```

> Check out the [`sortBy` documentation](/fetching#sortbykey-direction)
> Check out the [`sortBy` documentation](/v1/getting-started/fetching#sortbykey-direction)

### Table of contents

Expand Down Expand Up @@ -218,7 +218,7 @@ export default {
</script>
```

> Check out the [Table of contents documentation](/writing#table-of-contents)
> Check out the [Table of contents documentation](/v1/getting-started/writing#table-of-contents)

### Dynamic routing

Expand Down
Loading