Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
feat(content): update content to latest Docus
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Jun 17, 2022
1 parent 9ee3f12 commit fa8c277
Show file tree
Hide file tree
Showing 149 changed files with 469 additions and 418 deletions.
7 changes: 4 additions & 3 deletions docs/content/1.getting-started/2.migration.md
@@ -1,6 +1,7 @@
# Migration Guide

Already have a Nuxt project to migrate? These migration guides are for users wanting to upgrade their Nuxt application to Nuxt 3 or take the first step in that direction with Nuxt Bridge.
---
title: "Migration Guide"
description: "Already have a Nuxt project to migrate? These migration guides are for users wanting to upgrade their Nuxt application to Nuxt 3 or take the first step in that direction with Nuxt Bridge."
---

- [**From Nuxt 2 to Nuxt 3**](/migration/overview)
- [From Nuxt 2 to Nuxt Bridge](/bridge/overview)
Expand Down
1 change: 1 addition & 0 deletions docs/content/1.getting-started/_dir.yml
@@ -0,0 +1 @@
title: Get Started
1 change: 0 additions & 1 deletion docs/content/1.getting-started/index.md
@@ -1,5 +1,4 @@
---
title: Get Started
navigation: false
redirect: /getting-started/quick-start
---
7 changes: 4 additions & 3 deletions docs/content/2.guide/1.concepts/1.introduction.md
@@ -1,6 +1,7 @@
# What is Nuxt?

Nuxt's goal is to make web development intuitive and performant with a great developer experience in mind.
---
title: "What is Nuxt?"
description: "Nuxt's goal is to make web development intuitive and performant with a great developer experience in mind."
---

## Why Nuxt?

Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/1.concepts/2.vuejs-development.md
@@ -1,6 +1,7 @@
# Vue.js Development

Nuxt uses Vue as a frontend framework and adds features such as component auto-imports and file-based routing. Nuxt 3 integrates Vue 3, the new major release of Vue that enables new patterns for Nuxt users.
---
title: "Vue.js Development"
description: "Nuxt uses Vue as a frontend framework and adds features such as component auto-imports and file-based routing. Nuxt 3 integrates Vue 3, the new major release of Vue that enables new patterns for Nuxt users."
---

## Vue.js

Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/1.concepts/3.rendering.md
@@ -1,6 +1,7 @@
# Rendering Modes

Both the browser and server can interpret JavaScript code to render Vue.js components into HTML elements. This step is called **rendering**. Nuxt supports both **client-side** and **universal** rendering. The two approaches have pros and cons that we will cover in this section.
---
title: "Rendering Modes"
description: "Both the browser and server can interpret JavaScript code to render Vue.js components into HTML elements. This step is called **rendering**. Nuxt supports both **client-side** and **universal** rendering. The two approaches have pros and cons that we will cover in this section."
---

## Client-side only rendering

Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/1.concepts/4.auto-imports.md
@@ -1,6 +1,7 @@
# Auto Imports

Nuxt auto-imports helper functions, composables and Vue APIs to use across your application without explicitly importing them. Based on the directory structure, every Nuxt application can also use auto-imports for its own components, composables and plugins. Components, composables or plugins can use these functions.
---
title: "Auto Imports"
description: "Nuxt auto-imports helper functions, composables and Vue APIs to use across your application without explicitly importing them. Based on the directory structure, every Nuxt application can also use auto-imports for its own components, composables and plugins. Components, composables or plugins can use these functions."
---

Contrary to a classic global declaration, Nuxt preserves typings and IDEs completions and hints, and only includes what is actually used in your production code.

Expand Down
8 changes: 5 additions & 3 deletions docs/content/2.guide/1.concepts/4.server-engine.md
@@ -1,8 +1,10 @@
# Server Engine

Nuxt 3 is powered by a new server engine, code-named "Nitro".
---
title: "Server Engine"
description: "Nuxt 3 is powered by a new server engine, code-named \"Nitro\"."
---

This engine has many benefits:

::list

- Cross-platform support for Node.js, Browsers, service-workers and more.
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/1.concepts/6.typescript.md
@@ -1,6 +1,7 @@
# TypeScript

Nuxt 3 is fully typed and provides helpful shortcuts to ensure you have access to accurate type information when you are coding.
---
title: "TypeScript"
description: "Nuxt 3 is fully typed and provides helpful shortcuts to ensure you have access to accurate type information when you are coding."
---

## Type-checking

Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.guide/1.concepts/index.md
@@ -1,5 +1,5 @@
---
title: Concepts
title: "Concepts"
navigation: false
redirect: /guide/concepts/introduction
---
4 changes: 3 additions & 1 deletion docs/content/2.guide/2.features/1.views.md
@@ -1,4 +1,6 @@
# Views
---
title: "Views"
---

::NeedContribution
::
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/2.features/10.runtime-config.md
@@ -1,6 +1,7 @@
# Runtime Config

Nuxt provides a runtime config API to expose config within your application and server routes with the ability to update them at runtime using environment variables.
---
title: "Runtime Config"
description: "Nuxt provides a runtime config API to expose config within your application and server routes with the ability to update them at runtime using environment variables."
---

## Exposing runtime config

Expand Down
9 changes: 5 additions & 4 deletions docs/content/2.guide/2.features/11.teleports.md
@@ -1,8 +1,9 @@
# Teleports
---
title: "Teleports"
description: "Vue 3 provides the <Teleport> component which allows content to be rendered elsewhere in the DOM, outside of the Vue application."
---

Vue 3 provides the [`<Teleport>` component](https://vuejs.org/guide/built-ins/teleport.html) which allows content to be rendered elsewhere in the DOM, outside of the Vue application.

The `to` target of `<Teleport>` expects a CSS selector string or an actual DOM node. Nuxt currently has SSR support for teleports to `body` only, with client-side support for other targets using a `<ClientOnly>` wrapper.
The `to` target of [`<Teleport>`](https://vuejs.org/guide/built-ins/teleport.html) expects a CSS selector string or an actual DOM node. Nuxt currently has SSR support for teleports to `body` only, with client-side support for other targets using a `<ClientOnly>` wrapper.

## Example: body teleport

Expand Down
7 changes: 5 additions & 2 deletions docs/content/2.guide/2.features/13.modules.md
@@ -1,6 +1,9 @@
# Modules
---
title: "Modules"
description: "Nuxt provides a module system to extend the framework core and simplify integrations."
---

Nuxt provides a module system to extend the framework core and simplify integrations. You don't need to develop everything from scratch or maintain boilerplate if there is already a Nuxt module for it. Adding Nuxt modules is possible using [`nuxt.config`](/api/configuration/nuxt.config#modules).
You don't need to develop everything from scratch or maintain boilerplate if there is already a Nuxt module for it. Adding Nuxt modules is possible using [`nuxt.config`](/api/configuration/nuxt.config#modules).

## Exploring Nuxt Modules

Expand Down
4 changes: 3 additions & 1 deletion docs/content/2.guide/2.features/2.routing.md
@@ -1,4 +1,6 @@
# Routing
---
title: "Routing"
---

::NeedContribution
::
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/2.features/3.assets.md
@@ -1,6 +1,7 @@
# Assets

Nuxt uses two directories to handle assets like stylesheets, fonts or images:
---
title: "Assets"
description: "Nuxt uses two directories to handle assets like stylesheets, fonts or images."
---

- The [`public/` directory](/guide/directory-structure/public) content is served at the server root as-is.
- The [`assets/` directory](/guide/directory-structure/assets) contains by convention every asset that you want the build tool (Vite or Webpack) to process.
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/2.features/4.head-management.md
@@ -1,6 +1,7 @@
# Head Management

Out-of-the-box, Nuxt provides good default values for `charset` and `viewport` meta tags, but you can override these if you need to, as well as customize other meta tags for your site in several different ways.
---
title: "Head Management"
description: "Out-of-the-box, Nuxt provides good default values for charset and viewport meta tags, but you can override these if you need to, as well as customize other meta tags for your site in several different ways."
---

:ReadMore{link="/api/configuration/nuxt.config#head"}

Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/2.features/5.data-fetching.md
@@ -1,6 +1,7 @@
# Data Fetching

Nuxt provides `useFetch`, `useLazyFetch`, `useAsyncData` and `useLazyAsyncData` to handle data fetching within your application.
---
title: "Data Fetching"
description: "Nuxt provides useFetch, useLazyFetch, useAsyncData and useLazyAsyncData to handle data fetching within your application."
---

::alert{icon=👉}
**`useFetch`, `useLazyFetch`, `useAsyncData` and `useLazyAsyncData` only work during `setup` or `Lifecycle Hooks`**
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/2.features/6.state-management.md
@@ -1,6 +1,7 @@
# State Management

Nuxt provides `useState` composable to create a reactive and SSR-friendly shared state across components.
---
title: "State Management"
description: "Nuxt provides useState composable to create a reactive and SSR-friendly shared state across components."
---

`useState` is an SSR-friendly [`ref`](https://vuejs.org/api/reactivity-core.html#ref) replacement. Its value will be preserved after server-side rendering (during client-side hydration) and shared across all components using a unique key.

Expand Down
4 changes: 3 additions & 1 deletion docs/content/2.guide/2.features/7.error-handling.md
@@ -1,4 +1,6 @@
# Error Handling
---
title: "Error Handling"
---

## Handling errors

Expand Down
4 changes: 3 additions & 1 deletion docs/content/2.guide/2.features/8.plugins.md
@@ -1,4 +1,6 @@
# Plugins
---
title: "Plugins"
---

::NeedContribution
::
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/2.features/9.server-routes.md
@@ -1,6 +1,7 @@
# Server Routes

Nuxt automatically scans files inside the `~/server/api`, `~/server/routes`, and `~/server/middleware` directories to register API and server handlers with HMR support.
---
title: "Server Routes"
description: "Nuxt automatically scans files inside the ~/server/api, ~/server/routes, and ~/server/middleware directories to register API and server handlers with HMR support."
---

Each file should export a default function defined with `defineEventHandler()`.

Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.guide/2.features/index.md
@@ -1,5 +1,5 @@
---
title: Features
title: "Features"
navigation: false
redirect: /guide/features/views
---
10 changes: 3 additions & 7 deletions docs/content/2.guide/3.directory-structure/1.nuxt.md
@@ -1,14 +1,10 @@
---
icon: IconDirectory
title: '.nuxt'
head.title: Nuxt directory
title: ".nuxt"
description: "Nuxt uses the .nuxt/ directory in development to generate your Vue application."
head.title: "Nuxt directory"
---


# Nuxt directory

Nuxt uses the `.nuxt/` directory in development to generate your Vue application.

::alert{type=warning}
You should not touch any files inside since the whole directory will be re-created when running `nuxt dev`.
::
Expand Down
9 changes: 3 additions & 6 deletions docs/content/2.guide/3.directory-structure/10.pages.md
@@ -1,13 +1,10 @@
---
icon: IconDirectory
title: 'pages'
head.title: Pages directory
title: "page"
description: "Nuxt provides a file-based routing to create routes within your web application using Vue Router under the hood."
head.title: "Pages directory"
---

# Pages directory

Nuxt provides a file-based routing to create routes within your web application using [Vue Router](https://router.vuejs.org) under the hood.

::alert{type="info"}
This directory is **optional**, meaning that [`vue-router`](https://router.vuejs.org) won't be included if you only use [app.vue](/guide/directory-structure/app), reducing your application's bundle size.
::
Expand Down
9 changes: 4 additions & 5 deletions docs/content/2.guide/3.directory-structure/11.plugins.md
@@ -1,12 +1,11 @@
---
icon: IconDirectory
title: 'plugins'
head.title: Plugins directory
title: "plugins"
description: "Nuxt will automatically read the files in your plugins directory and load them."
head.title: "Plugins directory"
---

# Plugins directory

Nuxt will automatically read the files in your `plugins` directory and load them. You can use `.server` or `.client` suffix in the file name to load a plugin only on the server or client side.
You can use `.server` or `.client` suffix in the file name to load a plugin only on the server or client side.

::alert{type=warning}
All plugins in your `plugins/` directory are auto-registered, so you should not add them to your `nuxt.config` separately.
Expand Down
7 changes: 3 additions & 4 deletions docs/content/2.guide/3.directory-structure/12.public.md
@@ -1,11 +1,10 @@
---
icon: IconDirectory
title: public
head.title: Public directory
title: "public"
description: "The public/ directory is used to serve your website's assets."
head.title: "Public directory"
---

# Public directory

The `public/` directory is directly served at the server root and contains public files that have to keep their names (e.g. `robots.txt`) _or_ likely won't change (e.g. `favicon.ico`).

::alert{icon=💡}
Expand Down
6 changes: 2 additions & 4 deletions docs/content/2.guide/3.directory-structure/13.server.md
@@ -1,9 +1,7 @@
---
icon: IconDirectory
title: server
head.title: Server directory
title: "server"
head.title: "Server directory"
---

# Server directory

::ReadMore{link="/guide/features/server-routes"}
9 changes: 4 additions & 5 deletions docs/content/2.guide/3.directory-structure/14.gitignore.md
@@ -1,12 +1,11 @@
---
icon: IconFile
title: .gitignore
head.title: Gitignore file
title: ".gitignore"
description: "A .gitignore file specifies intentionally untracked files that git should ignore."
head.title: "Gitignore file"
---

# Gitignore file

A `.gitignore` file specifies intentionally untracked files that git should ignore. Learn more about it in [the git documentation](https://git-scm.com/docs/gitignore).
Learn more about it in [the git documentation](https://git-scm.com/docs/gitignore).

We recommend having a `.gitignore` file that has **at least** the following entries present:

Expand Down
9 changes: 3 additions & 6 deletions docs/content/2.guide/3.directory-structure/15.app.md
@@ -1,13 +1,10 @@
---
icon: IconFile
title: app.vue
head.title: App file
title: "app.vue"
description: "The app.vue file is the main component in your Nuxt 3 applications."
head.title: "App file"
---

# App file

The `app.vue` file is the main component in your Nuxt 3 applications.

## Minimal usage

With Nuxt 3, the [`pages/`](/guide/directory-structure/pages) directory is optional. If not present, Nuxt won't include [vue-router](https://router.vuejs.org/) dependency. This is useful when working on a landing page or an application that does not need routing.
Expand Down
9 changes: 4 additions & 5 deletions docs/content/2.guide/3.directory-structure/18.nuxt-config.md
@@ -1,12 +1,11 @@
---
icon: IconFile
title: nuxt.config.ts
head.title: Nuxt configuration file
title: "nuxt.config.ts"
description: "Nuxt can be easily configured with a single nuxt.config file."
head.title: "Nuxt configuration file"
---

# Nuxt configuration file

Nuxt can be easily configured with a single `nuxt.config` file, which can have either a `.js`, `.ts` or `.mjs` extension.
The file can have either a `.js`, `.ts` or `.mjs` extension.

```ts
import { defineNuxtConfig } from 'nuxt'
Expand Down
5 changes: 3 additions & 2 deletions docs/content/2.guide/3.directory-structure/18.package.md
@@ -1,7 +1,8 @@
---
icon: IconFile
title: package.json
head.title: Package file
title: "package.json"
description: "package.json file contains data about your Nuxt project dependencies."
head.title: "Package file"
---

# Package file
Expand Down
9 changes: 4 additions & 5 deletions docs/content/2.guide/3.directory-structure/19.tsconfig.md
@@ -1,12 +1,11 @@
---
icon: IconFile
title: tsconfig.json
head.title: TypeScript configuration file
title: "tsconfig.json"
description: "Nuxt automatically generates a .nuxt/tsconfig.json file with the resolved aliases you are using in your Nuxt project, as well as with other sensible defaults."
head.title: "TypeScript configuration file"
---

# TypeScript configuration file

Nuxt [automatically generates](/guide/concepts/typescript) a `.nuxt/tsconfig.json` file with the resolved aliases you are using in your Nuxt project, as well as with other sensible defaults. You can benefit from this by creating a `tsconfig.json` in the root of your project with the following content:
You can benefit from this by creating a [`tsconfig.json`](/guide/concepts/typescript) in the root of your project with the following content:

```json
{
Expand Down
8 changes: 3 additions & 5 deletions docs/content/2.guide/3.directory-structure/2.output.md
@@ -1,12 +1,10 @@
---
icon: IconDirectory
title: '.output'
head.title: Output directory
title: ".output"
description: "Nuxt creates the .output/ directory when building your application for production."
head.title: "Output directory"
---

# Output directory

Nuxt creates the `.output/` directory when building your application for production.

::alert{type=warning}
You should not touch any files inside since the whole directory will be re-created when running `nuxt build`.
Expand Down

0 comments on commit fa8c277

Please sign in to comment.