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.9.0 #2399

Merged
merged 38 commits into from
Oct 27, 2023
Merged

v2.9.0 #2399

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e783efd
fix(prose-pre): only wrap `slot` in `pre` (#2348)
farnabaz Sep 27, 2023
2b8cee9
chore(release): release v2.8.4
farnabaz Sep 27, 2023
1edb350
fix(prose-pre): `style` prop type
farnabaz Sep 28, 2023
a2bfb56
chore(deps): update all non-major dependencies (#2347)
renovate[bot] Sep 28, 2023
ec9a5ec
chore(release): release v2.8.5
farnabaz Sep 28, 2023
ea894c0
chore(deps): update dependency @nuxt/content to ^2.8.5 (#2353)
renovate[bot] Sep 29, 2023
1257cb5
fix(path-meta): prevent `undefined` error
farnabaz Sep 29, 2023
8ed394e
chore(deps): update devdependency vitest to ^0.34.6 (#2357)
renovate[bot] Sep 29, 2023
ee4ea3a
fix: types import
farnabaz Oct 4, 2023
a08dc1b
docs: update to latest ui-pro
atinux Oct 5, 2023
e58855f
docs: remove global style
atinux Oct 5, 2023
798a0a8
docs: add terms
atinux Oct 5, 2023
52debdf
Update 3.files.md (#2365)
migliozziz Oct 6, 2023
5248aa6
chore(deps): update devdependency @nuxthq/studio to v1 (#2361)
renovate[bot] Oct 9, 2023
9ec555e
fix: ignore regexes in fetchDirConfig (#2362)
gierschv Oct 9, 2023
1d84f0a
docs: add data pops in ContentRendererMarkdown and varaibles binding …
maximepvrt Oct 9, 2023
1fab215
chore(deps): update all non-major dependencies (#2359)
renovate[bot] Oct 11, 2023
b6ff9ba
docs: update examples for content helpers composable
atinux Oct 15, 2023
feca11b
docs: upgrade deps
atinux Oct 18, 2023
fe35792
docs: improve home
benjamincanac Oct 19, 2023
23a8ee7
docs: add links for shiki on home (#2386)
Barbapapazes Oct 20, 2023
59c1495
chore(deps): update actions/setup-node action to v4 (#2392)
renovate[bot] Oct 24, 2023
1e3549b
fix: optional experimental options (#2391)
arkhaiel Oct 24, 2023
0dc3abd
chore(deps): update all non-major dependencies (#2370)
renovate[bot] Oct 24, 2023
09dc1fb
chore(deps): update devdependency lint-staged to v15 (#2374)
renovate[bot] Oct 24, 2023
acfef26
chore(deps): lock file maintenance (#2379)
renovate[bot] Oct 24, 2023
e5d0029
feat: add type to layout (#2389)
Barbapapazes Oct 24, 2023
5daba0b
docs: update highlight.preload config (#2395)
ashour Oct 25, 2023
c675258
docs: grammatical tweaks on markdown page (#2394)
AaronBeaudoin Oct 25, 2023
4dab9b2
docs: update bindings with default value (#2397)
maximepvrt Oct 25, 2023
3cea513
chore(deps): update all non-major dependencies (#2396)
renovate[bot] Oct 26, 2023
f40e1a1
feat: add search (#2146)
Barbapapazes Oct 27, 2023
40a2e5d
docs: Update 3.search.md
atinux Oct 27, 2023
d255c89
chore(deps): update all non-major dependencies (#2400)
renovate[bot] Oct 27, 2023
061192c
fix: update types and imports
farnabaz Oct 27, 2023
a208567
fix: prevent duplicate parses
farnabaz Oct 27, 2023
dae9268
fix: prevent duplicate parses
farnabaz Oct 27, 2023
09980a7
chore(release): release v2.9.0
farnabaz Oct 27, 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 @@ -32,7 +32,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '16'
- uses: pnpm/action-setup@v2.4.0
Expand Down
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,76 @@
# Changelog


## v2.9.0

[compare changes](https://github.com/nuxt/content/compare/v2.8.5...v2.9.0)

### 🚀 Enhancements

- Add type to layout ([#2389](https://github.com/nuxt/content/pull/2389))
- Add search ([#2146](https://github.com/nuxt/content/pull/2146))

### 🩹 Fixes

- **path-meta:** Prevent `undefined` error ([1257cb5c](https://github.com/nuxt/content/commit/1257cb5c))
- Types import ([ee4ea3ad](https://github.com/nuxt/content/commit/ee4ea3ad))
- Ignore regexes in fetchDirConfig ([#2362](https://github.com/nuxt/content/pull/2362))
- Optional experimental options ([#2391](https://github.com/nuxt/content/pull/2391))
- Update types and imports ([061192c5](https://github.com/nuxt/content/commit/061192c5))
- Prevent duplicate parses ([a208567e](https://github.com/nuxt/content/commit/a208567e))
- Prevent duplicate parses ([dae92681](https://github.com/nuxt/content/commit/dae92681))

### 📖 Documentation

- Update to latest ui-pro ([a08dc1b8](https://github.com/nuxt/content/commit/a08dc1b8))
- Remove global style ([e58855fb](https://github.com/nuxt/content/commit/e58855fb))
- Add terms ([798a0a8c](https://github.com/nuxt/content/commit/798a0a8c))
- Add data pops in ContentRendererMarkdown and varaibles binding ([#2360](https://github.com/nuxt/content/pull/2360))
- Update examples for content helpers composable ([b6ff9ba2](https://github.com/nuxt/content/commit/b6ff9ba2))
- Upgrade deps ([feca11b6](https://github.com/nuxt/content/commit/feca11b6))
- Improve home ([fe357920](https://github.com/nuxt/content/commit/fe357920))
- Add links for shiki on home ([#2386](https://github.com/nuxt/content/pull/2386))
- Update highlight.preload config ([#2395](https://github.com/nuxt/content/pull/2395))
- Grammatical tweaks on markdown page ([#2394](https://github.com/nuxt/content/pull/2394))
- Update bindings with default value ([#2397](https://github.com/nuxt/content/pull/2397))
- Update 3.search.md ([40a2e5de](https://github.com/nuxt/content/commit/40a2e5de))

### ❤️ Contributors

- Farnabaz ([@farnabaz](http://github.com/farnabaz))
- Sébastien Chopin ([@Atinux](http://github.com/Atinux))
- Estéban <e.soubiran25@gmail.com>
- Maxime Pauvert ([@maximepvrt](http://github.com/maximepvrt))
- AaronBeaudoin <aaronjbeaudoin@gmail.com>
- Ashour <ashour.mohammad@gmail.com>
- Mathieu NICOLAS
- Benjamin Canac ([@benjamincanac](http://github.com/benjamincanac))
- Vincent Giersch <vincent@giersch.fr>

## v2.8.5

[compare changes](https://github.com/nuxt/content/compare/v2.8.4...v2.8.5)

### 🩹 Fixes

- **prose-pre:** `style` prop type ([1edb3501](https://github.com/nuxt/content/commit/1edb3501))

### ❤️ Contributors

- Farnabaz <farnabaz@gmail.com>

## v2.8.4

[compare changes](https://github.com/nuxt/content/compare/v2.8.3...v2.8.4)

### 🩹 Fixes

- **prose-pre:** Only wrap `slot` in `pre` ([#2348](https://github.com/nuxt/content/pull/2348))

### ❤️ Contributors

- Farnabaz <farnabaz@gmail.com>

## v2.8.3

[compare changes](https://github.com/nuxt/content/compare/v2.8.2...v2.8.3)
Expand Down
2 changes: 1 addition & 1 deletion docs/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# To use Nuxt UI Pro in production
NUXT_UI_PRO_TOKEN=
NUXT_UI_PRO_LICENSE=

# Used when pre-rendering the docs for dynamic OG images
NUXT_PUBLIC_SITE_URL=
9 changes: 9 additions & 0 deletions docs/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ export default defineAppConfig({
outline: 'ring-1 ring-inset ring-gray-700 text-white dark:text-white hover:bg-gray-900 disabled:bg-gray-300 dark:hover:bg-gray-900 dark:disabled:bg-gray-300 focus-visible:ring-2 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-400'
}
}
},
content: {
prose: {
code: {
icon: {
// terminal: 'i-ph-terminal'
}
}
}
}
},
elements: {
Expand Down
16 changes: 4 additions & 12 deletions docs/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const { data: files } = useLazyFetch('/api/search.json', {
const { data: nav } = await useAsyncData('navigation', () => fetchContentNavigation())

const navigation = computed(() => {
const main = nav.value.filter(item => item._path !== '/v1')
const v1 = nav.value.find(item => item._path === '/v1')?.children
const main = nav.value?.filter(item => item._path !== '/v1')
const v1 = nav.value?.find(item => item._path === '/v1')?.children

return route.path.startsWith('/v1/') ? v1 : main
})
Expand All @@ -48,7 +48,7 @@ provide('navigation', navigation)
<template>
<UHeader :links="links">
<template #logo>
<Logo class="h-5 w-auto" />
<Logo class="h-6 w-auto" />
</template>

<template #right>
Expand Down Expand Up @@ -81,7 +81,7 @@ provide('navigation', navigation)
<!-- Mobile panel -->
<template v-if="$route.path !== '/'" #panel>
<LazyUDocsSearchButton size="md" class="mb-4 w-full" />
<LazyUNavigationTree :links="mapContentNavigation(navigation)" default-open :multiple="false" />
<LazyUNavigationTree :links="mapContentNavigation(navigation!)" default-open :multiple="false" />
</template>
</UHeader>

Expand Down Expand Up @@ -129,11 +129,3 @@ provide('navigation', navigation)
<LazyUDocsSearch :files="files" :navigation="navigation" :links="links" />
</ClientOnly>
</template>

<style>
html.dark .shiki,
html.dark .shiki span {
color: var(--s-dark) !important;
background-color: var(--s-dark-bg) !important;
}
</style>
2 changes: 1 addition & 1 deletion docs/content/1.get-started/1.installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Before getting started, please **make sure to have installed the recommended set

1. You can start a fresh Nuxt Content project with:

```bash [npx]
```bash [Terminal]
npx nuxi@latest init content-app -t content
```

Expand Down
68 changes: 57 additions & 11 deletions docs/content/1.get-started/2.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,10 @@ export default defineNuxtConfig({
content: {
highlight: {
preload: [
{
id: 'gdscript',
scopeName: 'source.gdscript',
aliases: ['gdscript', 'gd'], // Use to mark code blocks in Markdown
grammar: JSON.parse(
readFileSync(
// Place the language grammar file somewhere in your project
'./shiki/languages/gdscript.tmLanguage.json'
).toString()
),
},
// Read more about shikiji languages: https://github.com/antfu/shikiji#fine-grained-bundle
JSON.parse(
readFileSync('./shiki/languages/gdscript.tmLanguage.json', 'utf-8'),
),
],
},
},
Expand Down Expand Up @@ -408,3 +401,56 @@ export default defineNuxtConfig({
- Default: `{}`

Options for yaml parser.

## `experimental`

### `search`

- Type: `boolean | undefined`{lang=ts}
- Default: `undefined`{lang=ts}

Enable search feature.

#### `indexed`

- Type: `boolean`{lang=ts}
- Default: `true`{lang=ts}

Enable indexed search. This will generate a search index file that allow faster and more performant search.

#### `ignoredTags`

- Type: `string[]`{lang=ts}
- Default: `['style', 'code']`{lang=ts}

List of tags to ignore when parsing content for the search API response. This is useful to avoid including code snippets in the search results or style that does not provide any useful information.

#### `filterQuery`

- Type: `QueryBuilderWhere`{lang=ts}
- Default: `{}`{lang=ts}

Query to ignore when parsing content for the search API response. This is useful to avoid including content that is not meant to be searchable like drafts or private content.

#### `options`

- Type: `object`{lang=ts}
- Default:

```ts
{
fields: ['title', 'content', 'titles'],
storeFields: ['title', 'content', 'titles'],
searchOptions: {
prefix: true,
fuzzy: 0.2,
boost: {
title: 4,
content: 2,
titles: 1
}
}
}
```

When the indexed search is enabled, this option will automatically configure both the API endpoint and the `searchContent` composable. For simple search, you will need to pass the options to the `searchContent` composable.
41 changes: 40 additions & 1 deletion docs/content/2.usage/2.markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "Nuxt Content uses the Markdown syntax and conventions to provide a

## Introduction

We create the MDC syntax to superchage the Markdown syntax to give the ability to leverage the power of Vue components with slots and props.
We created the MDC syntax to supercharge Markdown and give you the ability to leverage the power of Vue components with slots and props.

::callout
Install the [MDC VS Code extension](https://marketplace.visualstudio.com/items?itemName=Nuxt.mdc) to get proper syntax highlighting for your MDC components.
Expand Down Expand Up @@ -458,6 +458,45 @@ In addition to mdc components and `span`, attribute syntax will work on images,
::
::

## Binding Data in Markdown

You can bind data within your Markdown document using the `{{ $doc.variable || 'defaultValue' }}` syntax. These values can be defined in the YAML front matter at the top of the document, within each MDC component, or injected using the `data` prop of the `<ContentRendererMarkdown>` component.

### Example 1: Define in YAML

```md
---
title: 'Title of the page'
description: 'meta description of the page'
customVariable: 'Custom Value'
---

# The Title is {{ $doc.title }} and customVariable is {{ $doc.customVariable || 'defaultValue' }}

```

### Example 2: Define in external with `<ContentRendererMarkdown>`

```html
<template>
<div>
<ContentRendererMarkdown :value="data" :data="mdcVars"/>
<button type="button" v-on:click="mdcVars.name = 'Hugo'">Change name</button>
</div>
</template>

<script setup lang="ts">
const { data } = await useAsyncData(() => queryContent('test').findOne());
const mdcVars = ref({ name: 'Maxime'});
</script>
```

```md

# Hello {{ $doc.name || 'World' }}

```

## Prose Components

In Nuxt Content, the prose represents HTML tags generated by the Markdown syntax, such as title levels and links.
Expand Down
6 changes: 3 additions & 3 deletions docs/content/2.usage/3.files.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Nuxt Content can query JSON formatted content.
```

```ts [Query]
await queryContent('/hello').fetchOne()
await queryContent('/hello').findOne()
```

```js [Output]
Expand Down Expand Up @@ -53,7 +53,7 @@ category: announcement
```

```ts [Query]
await queryContent('/hello').fetchOne()
await queryContent('/hello').findOne()
```

```js [Output]
Expand Down Expand Up @@ -89,7 +89,7 @@ Hello Content v2!,The writing experience for Nuxt 3,announcement
```

```ts [Query]
await queryContent('/hello').fetchOne()
await queryContent('/hello').findOne()
```

```js [Output]
Expand Down
Loading
Loading