Skip to content

Commit 5ed69d9

Browse files
authored
feat: docs for v2 stable (#338)
1 parent a45bd85 commit 5ed69d9

File tree

327 files changed

+6257
-13776
lines changed

Some content is hidden

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

327 files changed

+6257
-13776
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ sw.*
1313

1414
# Local Netlify folder
1515
.netlify
16+
17+
.content

.nuxtrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
typescript.includeWorkspace=true
2-
imports.autoImport=false
2+
imports.autoImport=true

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Harlan Wilton <https://github.com/harlan-zw>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: 'What Is Nuxt SEO?'
3+
description: 'Learn what Nuxt SEO is and how it can help you with your Nuxt site.'
4+
navigation:
5+
title: 'What Is Nuxt SEO'
6+
---
7+
8+
Nuxt SEO is both a collection of modules and a module itself. The Nuxt SEO module is all the SEO modules combined into one that is guaranteed to work well together.
9+
10+
- [Nuxt Robots](/robots)
11+
- [Nuxt Sitemap](/sitemap)
12+
- [Nuxt OG Image](/og-image)
13+
- [Nuxt Schema.org](/schema-org)
14+
- [Nuxt SEO Utils](/experiments)
15+
- [Nuxt Link Checker](/link-checker)
16+
17+
There is no right or wrong way to use Nuxt SEO. It's designed to be flexible and work however you need it to.
18+
19+
To minimise config and ensure the modules work well together, [Nuxt Site Config](/site-config) is installed automatically when using any of the modules.

docs/content/0.nuxt-seo/1.getting-started/1.installation.md content/nuxt-seo/1.getting-started/1.installation.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,20 @@ navigation:
77

88
## Setup
99

10-
1. Install `@nuxtjs/seo` dependency to your project:
10+
1. Install SEO dependencies to your project:
1111

1212
```bash
1313
npx nuxi@latest module add seo
1414
```
1515

1616
## Site URL
1717

18-
:UBadge{color="amber" variant="solid" label="Important"}
19-
2018
Many of the Nuxt SEO modules will need to know what your production canonical URL is to avoid issues.
2119

2220
You can learn to set one by reading the [Recommended Site Config](/nuxt-seo/guides/configuring-modules) guide.
2321

2422
## Staging / Testing Environments
2523

26-
:UBadge{color="amber" variant="solid" label="Important"}
27-
2824
If you're using Preview / Staging / Testing environments you will need to add some additional configuration.
2925

3026
Learn how by reading the [Disabling Indexing](/robots/guides/disable-indexing) guide.

docs/content/0.nuxt-seo/1.getting-started/2.faq.md content/nuxt-seo/1.getting-started/2.faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ production build by a few megabytes, but won't affect the performance of your si
1818
If the production build size is a concern, you can disable the modules you don't need. The OG Image module
1919
contributes the most significant amount, you can disable it with `ogImage: { enabled: false }`.
2020

21-
## What happened To Nuxt Seo Kit?
21+
## What happened To Nuxt SEO Kit?
2222

2323
The Nuxt SEO Kit module was the initial version of Nuxt SEO.
2424

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
2-
title: "Reproductions: Stackblitz"
2+
title: "Reproductions: StackBlitz"
33
description: Create minimal reproductions for Nuxt SEO or just experiment with the module.
44
---
55

6-
You can use the Nuxt SEO Stackblitz playgrounds for either:
6+
You can use the Nuxt SEO StackBlitz playgrounds for either:
7+
78
- Playing around with the module in a sandbox environment
89
- Making reproductions for issues (Learn more about [Why Reproductions are Required](https://antfu.me/posts/why-reproductions-are-required))
910

10-
## Stackblitz Playgrounds
11+
## StackBlitz Playgrounds
1112

1213
- [Basic](https://stackblitz.com/edit/nuxt-starter-gfrej6?file=nuxt.config.ts)

docs/content/0.nuxt-seo/2.guides/0.using-the-modules.md content/nuxt-seo/2.guides/0.using-the-modules.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ A few extra SEO Nuxt features that don't fit anywhere else.
6666
Since Nuxt SEO installs and enables modules for you, you may run into a situation where you want to disable a module.
6767

6868
The modules have these config keys:
69+
6970
- `nuxt-og-image` - `ogImage`
7071
- `@nuxtjs/sitemap` - `sitemap`
7172
- `@nuxtjs/robots` - `robots`
@@ -75,7 +76,7 @@ The modules have these config keys:
7576

7677
You can disable any of these modules by setting the module's `enabled` value to `false` in your `nuxt.config.ts` file.
7778

78-
```ts [nuxt.config.ts]
79+
```ts twoslash [nuxt.config.ts]
7980
export default defineNuxtConfig({
8081
ogImage: {
8182
enabled: false

docs/content/0.nuxt-seo/2.guides/1.configuring-modules.md content/nuxt-seo/2.guides/1.configuring-modules.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ description: Configure all Nuxt SEO modules in one place using Nuxt Site Config.
77
all modules at runtime, for example in a multi-tenant or i18n app.
88

99
It's recommended to set the following config:
10+
1011
- `url` - The canonical URL of your site, avoids duplicate content and consolidates page rank.
1112
- `name` - The name of your site, used in the title and meta tags.
1213
- `description` - The description of your site, used in the meta tags.
1314
- `defaultLocale` - The default locale of your site, used in the meta tags. (you can omit this if you're using `@nuxtjs/i18n`)
1415

15-
```ts [nuxt.config.ts]
16+
```ts twoslash [nuxt.config.ts]
1617
export default defineNuxtConfig({
1718
site: {
1819
url: 'https://example.com',
File renamed without changes.
File renamed without changes.

docs/content/0.nuxt-seo/2.guides/2.title-templates.md content/nuxt-seo/2.seo-guides/2.title-templates.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: How to make the most of the title templating engine from Unhead.
55

66
The default title template for your site is equivalent to:
77

8-
```ts
8+
```ts twoslash
99
useHead({
1010
titleTemplate: '%s %separator %siteName'
1111
})
@@ -16,13 +16,15 @@ useHead({
1616
These tokens that are prefixed with `%` are making use of [Template Params](https://unhead.unjs.io/usage/guides/template-params).
1717

1818
The following tokens are available out-of-the-box:
19+
1920
- `%siteName` - The name of your site.
2021
- `%siteUrl` - The canonical URL of your site.
2122
- `%s` or `%pageTitle` - The page title, without the template
2223
- `%separator` - Special token used to separate parts of your title. These have special behaviour in that
2324
they will be logically removed when it makes sense. See [Separator](https://unhead.unjs.io/usage/guides/template-params#separator) for more details.
2425

2526
These tokens are available not only for the title, but also:
27+
2628
- `meta: [ { content: '%site.url/my-url.png' } ]`
2729
- `script: [ { type: 'application/json', content: { title: '%s' } } ]`
2830

@@ -34,7 +36,7 @@ For example, if you'd like to change the separator (the default is `|`), you can
3436

3537
::code-group
3638

37-
```ts [nuxt.config.ts]
39+
```ts twoslash [nuxt.config.ts]
3840
export default defineNuxtConfig({
3941
app: {
4042
head: {
@@ -47,13 +49,15 @@ export default defineNuxtConfig({
4749
})
4850
```
4951

50-
```vue [app.vue]
52+
```vue twoslash [app.vue]
53+
<script setup lang="ts">
5154
useHead({
5255
templateParams: {
5356
separator: '-'
5457
// other common separators: '·', '—', '•'
5558
}
5659
})
60+
</script>
5761
```
5862

5963
::
@@ -62,7 +66,7 @@ useHead({
6266

6367
If you need to modify the default `titleTemplate`, it's recommended to do it through nuxt.config.
6468

65-
```ts [nuxt.config.ts]
69+
```ts twoslash [nuxt.config.ts]
6670
export default defineNuxtConfig({
6771
app: {
6872
head: {
@@ -74,7 +78,7 @@ export default defineNuxtConfig({
7478

7579
Likewise if you'd like to use a different template for a subset of pages, you can use `useHead`.
7680

77-
```vue [pages/blog/tutorials/how-to-use-titles.vue]
81+
```vue twoslash [pages/blog/tutorials/how-to-use-titles.vue]
7882
<script lang="ts" setup>
7983
useHead({
8084
templateParams: {

docs/content/0.nuxt-seo/2.guides/3.trailing-slashes.md content/nuxt-seo/2.seo-guides/3.trailing-slashes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Nuxt SEO allows you to enable global trailing slashes using site config.
1919

2020
This will automatically add trailing slashes to your sitemap, canonical URLs and more.
2121

22-
```ts [nuxt.config.ts]
22+
```ts twoslash [nuxt.config.ts]
2323
export default defineNuxtConfig({
2424
site: {
2525
trailingSlash: true,

docs/content/0.nuxt-seo/3.api/4.breadcrumbs.md content/nuxt-seo/3.api/4.breadcrumbs.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ It's important to do this within the `defineBreadcrumbItems` function, as it wil
2828

2929
If you need to modify the breadcrumb for a specific static route, you can use the `breadcrumb` property of the route meta.
3030

31-
```vue [Page Meta]
31+
```vue twoslash [Page Meta]
3232
<script lang="ts" setup>
3333
definePageMeta({
3434
breadcrumb: {
@@ -53,7 +53,7 @@ will be removed.
5353
For example, if you have the path `/blog/my-post` and you want to override the `my-post` segment, we need
5454
to target the third item in the array.
5555

56-
```ts
56+
```ts twoslash
5757
// path: /blog/my-post will generate ['Home', 'Blog', 'My Post']
5858
useBreadcrumbItems({
5959
overrides: [
@@ -72,7 +72,9 @@ useBreadcrumbItems({
7272

7373
If you need to add items to the end or beginning of the breadcrumb, you can use the `append` and `prepend` props.
7474

75-
```ts
75+
```ts twoslash
76+
import { useBreadcrumbItems } from '#imports'
77+
7678
useBreadcrumbItems({
7779
append: [
7880
{
File renamed without changes.
File renamed without changes.

docs/content/0.nuxt-seo/6.migration-guide/0.nuxt-seo-kit.md content/nuxt-seo/6.migration-guide/0.nuxt-seo-kit.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export default defineNuxtConfig({
106106
::
107107

108108
When updating your config:
109+
109110
- All keys are without the `site` prefix
110111
- The `language` config has been renamed to `defaultLocale`
111112

@@ -138,6 +139,7 @@ export default defineNuxtConfig({
138139
### Nuxt Robots
139140

140141
Upgraded from v1 to v3:
142+
141143
- [v2 release notes](https://github.com/harlan-zw/nuxt-simple-robots/releases/tag/v2.0.0)
142144
- [v3 release notes](/robots/releases/v3)
143145

@@ -146,6 +148,7 @@ No breaking changes.
146148
### Nuxt Sitemap
147149

148150
Upgraded from v1 to v3:
151+
149152
- [v2 release notes](https://github.com/nuxt-modules/sitemap/releases/tag/v2.0.0)
150153
- [v3 release notes](/sitemap/releases/v3)
151154

@@ -154,13 +157,15 @@ No breaking changes.
154157
### Nuxt Schema.org
155158

156159
Upgraded from v2 to v3:
160+
157161
- [v3 release notes](/schema-org/releases/v3)
158162

159163
No breaking changes.
160164

161165
### Nuxt OG Image
162166

163167
Upgraded from v1 to v2:
168+
164169
- [v2 release notes](/og-image/releases/v2)
165170

166171
The following options have been removed from nuxt.config `ogImage`:
@@ -183,7 +188,7 @@ If you were referencing the old default template, you will need to update it.
183188
Composables & Components:
184189

185190
- `defineOgImageStatic()` is deprecated, use `defineOgImage()` (default behaviour is to cache), if you want to be verbose you can use `defineOgImageCached()` or `<OgImageCached />`
186-
- `<OgImageStatic />` is deprecated, use `<OgImage />`
191+
- `<OgImageStatic />` is deprecated, use `<OgImage />`
187192
- `defineOgImageDynamic()` is deprecated, use `defineOgImageWithoutCache()`
188193
- `<OgImageDynamic />` is deprecated, use `<OgImageWithoutCache />`
189194

@@ -216,17 +221,20 @@ defineOgImage({ /* */ })
216221
### Nuxt Link Checker
217222

218223
Upgraded from v1 to v2:
224+
219225
- [v2 release notes](/link-checker/releases/v2)
220226

221227
Changes to nuxt.config `linkChecker`:
228+
222229
- `exclude` renamed to `excludeLinks`
223230
- `failOn404` renamed to `failOnError`
224231

225-
### Nuxt SEO Experiments
232+
### Nuxt SEO Utils
226233

227-
The `nuxt-unhead` module has been renamed to `nuxt-seo-experiments`. This is to better reflect the scope of the module.
234+
The `nuxt-unhead` module has been renamed to `nuxt-seo-utils`. This is to better reflect the scope of the module.
228235

229236
Upgraded from v1 to v3:
237+
230238
- [v2 release notes](https://github.com/harlan-zw/nuxt-link-checker/releases/2.0.0)
231239
- [v2 release notes](/link-checker/releases/v3)
232240

content/nuxt-seo/_dir.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: Nuxt SEO

docs/.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true

docs/.nuxtrc

-2
This file was deleted.

docs/app.config.ts

-28
This file was deleted.

docs/app/app.config.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export default defineAppConfig({
2+
toaster: {
3+
position: 'bottom-right' as const,
4+
expand: true,
5+
duration: 5000,
6+
},
7+
theme: {
8+
radius: 0.1,
9+
},
10+
ui: {
11+
colors: {
12+
primary: 'green',
13+
gray: 'slate',
14+
},
15+
},
16+
uiPro: {
17+
prose: {
18+
codeIcon: {
19+
'robots.txt': 'vscode-icons:file-type-robots',
20+
},
21+
},
22+
},
23+
})

0 commit comments

Comments
 (0)