Skip to content

Commit

Permalink
Merge branch 'main' into feat/update-to-advanced-ignores-pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jun 9, 2023
2 parents fab6733 + d0e5d6a commit 75ee202
Show file tree
Hide file tree
Showing 32 changed files with 4,060 additions and 3,429 deletions.
13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ body:
attributes:
value: |
Please carefully read the contribution docs before creating a bug report
👉 https://v3.nuxtjs.org/community/reporting-bugs
Please use the template below to create a minimal reproduction
👉 https://stackblitz.com/github/nuxt/starter/tree/content
👉 https://nuxt.com/docs/community/reporting-bugs
Please use one of the templates below to create a minimal reproduction:
👉 https://stackblitz.com/github/nuxt/starter/tree/content for general issues
👉 https://stackblitz.com/github/nuxt/starter/tree/doc-driven for document-driven mode issues
- type: textarea
id: bug-env
attributes:
Expand All @@ -21,7 +22,7 @@ body:
id: reproduction
attributes:
label: Reproduction
description: Please provide a link to a repo that can reproduce the problem you ran into. A [**minimal reproduction**](https://v3.nuxtjs.org/community/reporting-bugs#create-a-minimal-reproduction) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided we might close it.
description: Please provide a link to a repo that can reproduce the problem you ran into. A [**minimal reproduction**](https://nuxt.com/docs/community/reporting-bugs#create-a-minimal-reproduction) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided we might close it.
placeholder: Reproduction
validations:
required: true
Expand All @@ -37,11 +38,11 @@ body:
id: additonal
attributes:
label: Additional context
description: If applicable, add any other context about the problem here`
description: If applicable, add any other context about the problem here.
- type: textarea
id: logs
attributes:
label: Logs
description: |
Optional if provided reproduction. Please try not to insert an image but copy paste the log text.
render: shell
render: Shell
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
version: 7
version: 8
- run: pnpm install
- run: pnpm prepare
- run: pnpm lint
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Nuxt Content reads the `content/` directory in your project, parses `.md`, `.yml

## Features

- [**Nuxt 3**](https://v3.nuxtjs.org) support
- [**Nuxt 3**](https://nuxt.com) support
- A Markdown syntax made for Vue components ([**MDC**](https://content.nuxtjs.org/guide/writing/mdc))
- Navigation generation
- Code highlighting with [**Shiki**](https://shiki.matsu.io)
Expand All @@ -26,11 +26,11 @@ Nuxt Content reads the `content/` directory in your project, parses `.md`, `.yml
- Table of contents generation
- Also handles CSV, YAML and JSON(5)
- Extend with hooks and content plugins
- [...and more](https://content.nuxtjs.org)
- [... and more](https://content.nuxtjs.org)

## Nuxt 2

Nuxt 2 is supported with Content v1, documentation is on https://content.nuxtjs.org/content-v1 and the code on the [v1](https://github.com/nuxt/content/tree/v1) branch.
Nuxt 2 is supported with Content v1, documentation is on <https://content.nuxtjs.org/content-v1> and the code on the [v1](https://github.com/nuxt/content/tree/v1) branch.

## 💻 Development

Expand All @@ -43,7 +43,6 @@ Nuxt 2 is supported with Content v1, documentation is on https://content.nuxtjs.

[MIT](./LICENSE) - Made with 💚


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

Expand Down
4 changes: 2 additions & 2 deletions docs/content/2.get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Before getting started, please **make sure to have installed the recommended set

::code-group
```bash [npx]
npx nuxi init content-app -t content
npx nuxi@latest init content-app -t content
```

```bash [pnpm]
pnpm dlx nuxi init content-app -t content
pnpm dlx nuxi@latest init content-app -t content
```
::

Expand Down
2 changes: 1 addition & 1 deletion docs/content/3.guide/1.writing/3.mdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Install the [MDC VS Code extension](https://marketplace.visualstudio.com/items?i

Block components are components that accept Markdown content or another component as a slot.

Any component in the `components/content/` directory or [made available globally](https://v3.nuxtjs.org/guide/directory-structure/components) in your application can be used in Markdown files.
Any component in the `components/content/` directory or [made available globally](https://nuxt.com/docs/guide/directory-structure/components) in your application can be used in Markdown files.

The component must contain either:

Expand Down
4 changes: 2 additions & 2 deletions docs/content/3.guide/1.writing/7.document-driven.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ You can also use an object to configure the behavior of the mode, checkout the [

## Catch-all page

The document driven mode ships a pre-configured [catch-all route](https://v3.nuxtjs.org/guide/directory-structure/pages#catch-all-route).
The document driven mode ships a pre-configured [catch-all route](https://nuxt.com/docs/guide/directory-structure/pages#catch-all-route).

This [injected Vue page](https://github.com/nuxt/content/blob/main/src/runtime/pages/document-driven.vue) is useful for having a minimal project structure:

Expand Down Expand Up @@ -110,7 +110,7 @@ This option will search for a `theme` key in `globals`, then search for a `layou

## Global variables

Queries are being made from a [route middleware](https://v3.nuxtjs.org/guide/directory-structure/middleware#middleware-directory) and are resolved before your page renders.
Queries are being made from a [route middleware](https://nuxt.com/docs/guide/directory-structure/middleware#middleware-directory) and are resolved before your page renders.

This gives access to the [`useContent()`](/api/composables/use-document-driven) composable **anywhere in your app** with the following variables:

Expand Down
2 changes: 1 addition & 1 deletion docs/content/3.guide/2.displaying/1.rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The `<ContentDoc>` component fetches a document and renders it in a rich-text fo

The fetching endpoint defaults to the current route (`$route.path`). An explicit path can be passed to the component with the `path` props.

Create a [catch all route](https://v3.nuxtjs.org/guide/directory-structure/pages/#catch-all-route) named `pages/[...slug].vue` and add the component:
Create a [catch all route](https://nuxt.com/docs/guide/directory-structure/pages/#catch-all-route) named `pages/[...slug].vue` and add the component:

```vue [pages/[...slug].vue]
<template>
Expand Down
4 changes: 2 additions & 2 deletions docs/content/3.guide/2.displaying/2.querying.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ queryContent('/').find()
queryContent('/').findOne()
```

### With `useAsyncData`
### Wrap your query with `useAsyncData`

Wrap your query in the [`useAsyncData` composable](https://v3.nuxtjs.org/api/composables/use-async-data) (auto-imported as well).
To prevent fetching duplication on first load, wrap your query in the [`useAsyncData` composable](https://nuxt.com/docs/api/composables/use-async-data) (auto-imported as well).

```js
const { data } = await useAsyncData('home', () => queryContent('/').findOne())
Expand Down
9 changes: 8 additions & 1 deletion docs/content/4.api/2.composables/1.query-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,19 @@ const articles = await queryContent('articles')

```

> `sort()`{lang="ts"} method does **case-sensitive** sort by default. There is some magical options you can pass to sort options to change sort behavior, like sorting **case-insensitive**.
> `sort()`{lang="ts"} method does **case-sensitive, alphabetical** sort by default. There is some magical options you can pass to sort options to change sort behavior, like sorting **case-insensitive** or **numerically rather than alphabetically**.
>
> - `$sensitivity`{lang=ts}: Change case sensitivity. Like using `$sensitivity: 'base'`{lang=ts} for case-insensitive sort
> - `$numeric`{lang=ts}: Boolean whether numeric collation should be used, such that `"1" < "2" < "10"`.
> - `$caseFirst`{lang=ts}: Whether upper case or lower case should sort first.
For example, to sort a list of people from youngest to oldest:
```ts
const people = await queryContent('people')
.sort({ age: 1, $numeric: true })
.find()
```

These options are given to [Intl.Collator()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#parameters).

## `limit(count)`
Expand Down
30 changes: 30 additions & 0 deletions docs/content/4.api/3.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,36 @@ export default defineNuxtConfig({
})
```

If you wish to add highlighting for an unsupported language, you can do so by loading the grammar file for the language.

```ts
import { readFileSync } from 'fs'

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 adding languages in the [Shiki documentation](https://github.com/shikijs/shiki/blob/main/docs/languages.md#adding-grammar).


## `yaml`

- Type: `false | Object`{lang=ts}
Expand Down
2 changes: 1 addition & 1 deletion docs/content/5.examples/6.templates/1.content-wind.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ A lightweight Nuxt template to write a Markdown driven website with TailwindCSS
It leverages the [`document-driven mode`](/guide/writing/document-driven) to display the current Markdown page and the generated navigation.

- Repository: [Atinux/content-wind](https://github.com/Atinux/content-wind)
- Live demo: https://content-wind.nuxt.dev
- Live demo: https://content-wind.nuxt.space

:sandbox{repo="Atinux/content-wind" branch="main" file="app.vue"}
16 changes: 8 additions & 8 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"generate": "nuxi generate"
},
"resolutions": {
"nitropack": "2.3.3"
"nitropack": "2.4.1"
},
"devDependencies": {
"@docsearch/js": "^3.3.3",
"@nuxt-themes/docus": "^1.10.1",
"@nuxthq/studio": "^0.10.1",
"@nuxtlabs/github-module": "^1.6.2",
"monaco-editor-core": "^0.37.1",
"nuxt": "3.4.1",
"@docsearch/js": "^3.5.0",
"@nuxt-themes/docus": "^1.12.3",
"@nuxthq/studio": "^0.13.2",
"@nuxtlabs/github-module": "^1.6.3",
"monaco-editor-core": "^0.39.0",
"nuxt": "3.5.3",
"vue-plausible": "^1.3.2"
},
"packageManager": "pnpm@8.3.1",
"packageManager": "pnpm@8.6.1",
"pnpm": {
"peerDependencyRules": {
"allowedVersions": {
Expand Down

0 comments on commit 75ee202

Please sign in to comment.