From e71866480b3207947052422e589f880d91b8c33c Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 22 Oct 2024 02:14:36 +1100 Subject: [PATCH] chore: v2 progress --- README.md | 2 +- .../1.getting-started/0.what-is-nuxt-seo.md | 19 - .../1.getting-started/1.installation.md | 34 - content/nuxt-seo/1.getting-started/2.faq.md | 30 - .../1.getting-started/3.stackblitz.md | 13 - content/nuxt-seo/1.getting-started/_dir.yml | 1 - .../nuxt-seo/2.guides/0.using-the-modules.md | 107 - .../2.guides/1.configuring-modules.md | 37 - content/nuxt-seo/2.guides/4.i18n.md | 26 - content/nuxt-seo/2.guides/_dir.yml | 1 - .../2.seo-guides/2.title-templates.md | 92 - content/nuxt-seo/2.seo-guides/_dir.yml | 1 - content/nuxt-seo/3.api/4.breadcrumbs.md | 179 -- content/nuxt-seo/3.api/9.config.md | 44 - content/nuxt-seo/3.api/_breadcrumb-nuxt-ui.md | 9 - content/nuxt-seo/3.api/_breadcrumb-raw.md | 17 - content/nuxt-seo/3.api/_dir.yml | 1 - content/nuxt-seo/4.releases/_dir.yml | 1 - content/nuxt-seo/6.migration-guide/_dir.yml | 1 - content/nuxt-seo/_dir.yml | 1 - docs/app/app.config.ts | 2 +- docs/app/app.vue | 168 +- docs/app/components/Banner.vue | 5 +- docs/app/components/Discord.vue | 18 - docs/app/components/Header.vue | 164 +- docs/app/components/HeaderLinks.vue | 324 -- docs/app/components/HeaderLinksOld.vue | 371 --- .../components/HomeSectionContributors.vue | 122 - docs/app/components/{ => Inspira}/Dock.vue | 17 +- .../app/components/{ => Inspira}/DockIcon.vue | 45 +- docs/app/components/Inspira/Marquee.vue | 76 + docs/app/components/Inspira/ReviewCard.vue | 29 + docs/app/components/LegoGithubStar/index.vue | 42 - docs/app/components/LegoTweet/.keys.ts | 4 - docs/app/components/LegoTweet/Action.vue | 11 - docs/app/components/LegoTweet/Action/.keys.ts | 3 - docs/app/components/LegoTweet/Action/Copy.vue | 23 - .../components/LegoTweet/Action/CopyIcon.vue | 43 - docs/app/components/LegoTweet/Action/Love.vue | 24 - .../components/LegoTweet/Action/LoveIcon.vue | 11 - .../app/components/LegoTweet/Action/Reply.vue | 21 - .../components/LegoTweet/Action/ReplyIcon.vue | 11 - docs/app/components/LegoTweet/CreatedAt.vue | 26 - docs/app/components/LegoTweet/Link.vue | 9 - docs/app/components/LegoTweet/Media.vue | 49 - docs/app/components/LegoTweet/Media/Photo.vue | 16 - docs/app/components/LegoTweet/Media/Video.vue | 23 - docs/app/components/LegoTweet/Replies.vue | 24 - docs/app/components/LegoTweet/SummaryCard.vue | 56 - docs/app/components/LegoTweet/Terms.vue | 23 - docs/app/components/LegoTweet/Text.vue | 153 - docs/app/components/LegoTweet/User.vue | 16 - docs/app/components/LegoTweet/User/Avatar.vue | 19 - docs/app/components/LegoTweet/index.vue | 28 - docs/app/components/LegoTweet/utils.ts | 293 -- docs/app/components/ModuleCard.vue | 110 + docs/app/components/ModuleLabel.vue | 27 +- docs/app/components/OgImage/Home.vue | 16 +- docs/app/components/ShowcaseCardLink.vue | 38 - docs/app/components/TableOfContents.vue | 14 +- docs/app/components/Tweet.vue | 123 - docs/app/components/TwitterCardRenderer.vue | 74 - .../components/color-mode/ColorModeButton.vue | 5 +- docs/app/components/content/AllModules.vue | 9 + .../BreadcrumbNuxtUiExample.vue | 23 +- .../{examples => }/BreadcrumbRawExample.vue | 21 +- .../{examples => }/ComponentPropsSchema.vue | 0 docs/app/components/content/ModuleInstall.vue | 66 + .../app/components/content/OgImageExample.vue | 3 + .../content/SiteConfigQuickSetup.vue | 36 + docs/app/components/ui/Breadcrumb.vue | 103 + docs/app/components/ui/ContentNavigation.vue | 173 ++ docs/app/composables/data.ts | 125 + docs/app/composables/format.ts | 3 + docs/app/composables/markdown.ts | 3 + docs/app/composables/module.ts | 16 + docs/app/composables/nav.ts | 96 + docs/app/composables/state.ts | 25 + docs/app/layouts/docs.vue | 97 +- docs/app/layouts/learn.vue | 47 + docs/app/mdc.config.ts | 23 +- docs/app/mdc/dir.ts | 35 + docs/app/pages/docs/[...slug].vue | 72 +- docs/app/pages/index.vue | 1129 ++++--- docs/app/pages/learn.vue | 53 - docs/app/pages/learn/[...slug].vue | 99 + docs/app/pages/pro.vue | 65 + docs/app/pages/releases.vue | 116 + docs/app/utils/content-v2.ts | 0 docs/content.config.ts | 73 +- docs/content/learn/0.community-videos.md | 9 + .../content/learn}/1.going-live.md | 15 + .../learn/2.mastering-titles-in-nuxt.md | 154 + .../content/learn}/3.trailing-slashes.md | 12 + .../learn/4.multi-tenancy-seo-nuxt-apps.md | 10 + .../1.getting-started/0.introduction.md | 46 + .../1.getting-started/1.installation.md | 26 + .../1.getting-started/3.troubleshooting.md | 47 + .../nuxtSeo/2.guides/0.using-the-modules.md | 113 + .../nuxtSeo/2.guides/1.disabling-modules.md | 40 + .../6.migration-guide/0.rc-to-stable.md | 55 + .../6.migration-guide/1.beta-to-rc.md | 0 .../6.migration-guide/3.nuxt-seo-kit.md | 4 +- docs/nuxt.config.ts | 179 +- docs/package.json | 18 +- docs/server/api/github/[repo]/releases.get.ts | 24 + docs/server/api/github/[repo]/stars.get.ts | 23 + .../server/api/npm/[pkgName]/downloads.get.ts | 45 + docs/server/api/stats.ts | 47 +- docs/server/content-v2.ts | 3 +- docs/server/middleware/redirects.ts | 21 + package.json | 11 +- pnpm-lock.yaml | 2711 ++++++++++++++--- src/const.ts | 10 +- test/fixtures/basic/nuxt.config.ts | 1 + test/fixtures/basic/tsconfig.json | 2 +- test/fixtures/i18n/nuxt.config.ts | 5 - test/fixtures/i18n/tsconfig.json | 3 + test/integration/i18n.test.ts | 178 ++ test/integration/spa.test.ts | 69 + 120 files changed, 5903 insertions(+), 3781 deletions(-) delete mode 100644 content/nuxt-seo/1.getting-started/0.what-is-nuxt-seo.md delete mode 100644 content/nuxt-seo/1.getting-started/1.installation.md delete mode 100644 content/nuxt-seo/1.getting-started/2.faq.md delete mode 100644 content/nuxt-seo/1.getting-started/3.stackblitz.md delete mode 100644 content/nuxt-seo/1.getting-started/_dir.yml delete mode 100644 content/nuxt-seo/2.guides/0.using-the-modules.md delete mode 100644 content/nuxt-seo/2.guides/1.configuring-modules.md delete mode 100644 content/nuxt-seo/2.guides/4.i18n.md delete mode 100644 content/nuxt-seo/2.guides/_dir.yml delete mode 100644 content/nuxt-seo/2.seo-guides/2.title-templates.md delete mode 100644 content/nuxt-seo/2.seo-guides/_dir.yml delete mode 100644 content/nuxt-seo/3.api/4.breadcrumbs.md delete mode 100644 content/nuxt-seo/3.api/9.config.md delete mode 100644 content/nuxt-seo/3.api/_breadcrumb-nuxt-ui.md delete mode 100644 content/nuxt-seo/3.api/_breadcrumb-raw.md delete mode 100644 content/nuxt-seo/3.api/_dir.yml delete mode 100644 content/nuxt-seo/4.releases/_dir.yml delete mode 100644 content/nuxt-seo/6.migration-guide/_dir.yml delete mode 100644 content/nuxt-seo/_dir.yml delete mode 100644 docs/app/components/Discord.vue delete mode 100644 docs/app/components/HeaderLinks.vue delete mode 100644 docs/app/components/HeaderLinksOld.vue delete mode 100644 docs/app/components/HomeSectionContributors.vue rename docs/app/components/{ => Inspira}/Dock.vue (84%) rename docs/app/components/{ => Inspira}/DockIcon.vue (53%) create mode 100644 docs/app/components/Inspira/Marquee.vue create mode 100644 docs/app/components/Inspira/ReviewCard.vue delete mode 100644 docs/app/components/LegoGithubStar/index.vue delete mode 100644 docs/app/components/LegoTweet/.keys.ts delete mode 100644 docs/app/components/LegoTweet/Action.vue delete mode 100644 docs/app/components/LegoTweet/Action/.keys.ts delete mode 100644 docs/app/components/LegoTweet/Action/Copy.vue delete mode 100644 docs/app/components/LegoTweet/Action/CopyIcon.vue delete mode 100644 docs/app/components/LegoTweet/Action/Love.vue delete mode 100644 docs/app/components/LegoTweet/Action/LoveIcon.vue delete mode 100644 docs/app/components/LegoTweet/Action/Reply.vue delete mode 100644 docs/app/components/LegoTweet/Action/ReplyIcon.vue delete mode 100644 docs/app/components/LegoTweet/CreatedAt.vue delete mode 100644 docs/app/components/LegoTweet/Link.vue delete mode 100644 docs/app/components/LegoTweet/Media.vue delete mode 100644 docs/app/components/LegoTweet/Media/Photo.vue delete mode 100644 docs/app/components/LegoTweet/Media/Video.vue delete mode 100644 docs/app/components/LegoTweet/Replies.vue delete mode 100644 docs/app/components/LegoTweet/SummaryCard.vue delete mode 100644 docs/app/components/LegoTweet/Terms.vue delete mode 100644 docs/app/components/LegoTweet/Text.vue delete mode 100644 docs/app/components/LegoTweet/User.vue delete mode 100644 docs/app/components/LegoTweet/User/Avatar.vue delete mode 100644 docs/app/components/LegoTweet/index.vue delete mode 100644 docs/app/components/LegoTweet/utils.ts create mode 100644 docs/app/components/ModuleCard.vue delete mode 100644 docs/app/components/ShowcaseCardLink.vue delete mode 100644 docs/app/components/Tweet.vue delete mode 100644 docs/app/components/TwitterCardRenderer.vue create mode 100644 docs/app/components/content/AllModules.vue rename docs/app/components/content/{examples => }/BreadcrumbNuxtUiExample.vue (67%) rename docs/app/components/content/{examples => }/BreadcrumbRawExample.vue (76%) rename docs/app/components/content/{examples => }/ComponentPropsSchema.vue (100%) create mode 100644 docs/app/components/content/ModuleInstall.vue create mode 100644 docs/app/components/content/OgImageExample.vue create mode 100644 docs/app/components/content/SiteConfigQuickSetup.vue create mode 100644 docs/app/components/ui/Breadcrumb.vue create mode 100644 docs/app/components/ui/ContentNavigation.vue create mode 100644 docs/app/composables/data.ts create mode 100644 docs/app/composables/format.ts create mode 100644 docs/app/composables/markdown.ts create mode 100644 docs/app/composables/module.ts create mode 100644 docs/app/composables/nav.ts create mode 100644 docs/app/composables/state.ts create mode 100644 docs/app/layouts/learn.vue create mode 100644 docs/app/mdc/dir.ts delete mode 100644 docs/app/pages/learn.vue create mode 100644 docs/app/pages/learn/[...slug].vue create mode 100644 docs/app/pages/pro.vue create mode 100644 docs/app/pages/releases.vue delete mode 100644 docs/app/utils/content-v2.ts create mode 100644 docs/content/learn/0.community-videos.md rename {content/nuxt-seo/2.seo-guides => docs/content/learn}/1.going-live.md (76%) create mode 100644 docs/content/learn/2.mastering-titles-in-nuxt.md rename {content/nuxt-seo/2.seo-guides => docs/content/learn}/3.trailing-slashes.md (79%) create mode 100644 docs/content/learn/4.multi-tenancy-seo-nuxt-apps.md create mode 100644 docs/content/nuxtSeo/1.getting-started/0.introduction.md create mode 100644 docs/content/nuxtSeo/1.getting-started/1.installation.md create mode 100644 docs/content/nuxtSeo/1.getting-started/3.troubleshooting.md create mode 100644 docs/content/nuxtSeo/2.guides/0.using-the-modules.md create mode 100644 docs/content/nuxtSeo/2.guides/1.disabling-modules.md create mode 100644 docs/content/nuxtSeo/6.migration-guide/0.rc-to-stable.md rename {content/nuxt-seo => docs/content/nuxtSeo}/6.migration-guide/1.beta-to-rc.md (100%) rename content/nuxt-seo/6.migration-guide/0.nuxt-seo-kit.md => docs/content/nuxtSeo/6.migration-guide/3.nuxt-seo-kit.md (98%) create mode 100644 docs/server/api/github/[repo]/releases.get.ts create mode 100644 docs/server/api/github/[repo]/stars.get.ts create mode 100644 docs/server/api/npm/[pkgName]/downloads.get.ts create mode 100644 docs/server/middleware/redirects.ts create mode 100644 test/fixtures/i18n/tsconfig.json create mode 100644 test/integration/i18n.test.ts create mode 100644 test/integration/spa.test.ts diff --git a/README.md b/README.md index 5053511e..19049cc2 100755 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ With powerful APIs built for fully dynamic sites and zero-config defaults for st - 📖 [@nuxtjs/sitemap](https://github.com/nuxt-modules/sitemap) - Sitemap.xml Support - 🤖 [@nuxtjs/robots](https://github.com/nuxt-modules/robots) - Manage site crawling - 🔎 [nuxt-schema-org](https://github.com/harlan-zw/nuxt-schema-org) - Generate Schema.org JSON-LD for SEO -- △ [nuxt-seo-experiments](https://github.com/harlan-zw/nuxt-seo-experiments) - Experimental SEO meta features +- △ [nuxt-seo-utils](https://github.com/harlan-zw/nuxt-seo-utils) - Experimental SEO meta features - 🖼️ [nuxt-og-image](https://github.com/nuxt-modules/og-image) - Generate dynamic social share images - ✅ [nuxt-link-checker](https://github.com/harlan-zw/nuxt-link-checker) - Check for broken links diff --git a/content/nuxt-seo/1.getting-started/0.what-is-nuxt-seo.md b/content/nuxt-seo/1.getting-started/0.what-is-nuxt-seo.md deleted file mode 100644 index ec0526be..00000000 --- a/content/nuxt-seo/1.getting-started/0.what-is-nuxt-seo.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: 'What Is Nuxt SEO?' -description: 'Learn what Nuxt SEO is and how it can help you with your Nuxt site.' -navigation: - title: 'What Is Nuxt SEO' ---- - -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. - -- [Nuxt Robots](/robots) -- [Nuxt Sitemap](/sitemap) -- [Nuxt OG Image](/og-image) -- [Nuxt Schema.org](/schema-org) -- [Nuxt SEO Utils](/experiments) -- [Nuxt Link Checker](/link-checker) - -There is no right or wrong way to use Nuxt SEO. It's designed to be flexible and work however you need it to. - -To minimise config and ensure the modules work well together, [Nuxt Site Config](/site-config) is installed automatically when using any of the modules. diff --git a/content/nuxt-seo/1.getting-started/1.installation.md b/content/nuxt-seo/1.getting-started/1.installation.md deleted file mode 100644 index 76711bc5..00000000 --- a/content/nuxt-seo/1.getting-started/1.installation.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: 'Install Nuxt SEO' -description: 'Get started with Nuxt SEO by installing the dependency to your project.' -navigation: - title: 'Installation' ---- - -## Setup - -1. Install SEO dependencies to your project: - -```bash -npx nuxi@latest module add seo -``` - -## Site URL - -Many of the Nuxt SEO modules will need to know what your production canonical URL is to avoid issues. - -You can learn to set one by reading the [Recommended Site Config](/nuxt-seo/guides/configuring-modules) guide. - -## Staging / Testing Environments - -If you're using Preview / Staging / Testing environments you will need to add some additional configuration. - -Learn how by reading the [Disabling Indexing](/robots/guides/disable-indexing) guide. - -If you only have a production environment, you can skip this step. - -## Next Steps - -All modules are now installed and configured! - -See the [Using the Modules](/nuxt-seo/guides/using-the-modules) guide to learn how to use them. diff --git a/content/nuxt-seo/1.getting-started/2.faq.md b/content/nuxt-seo/1.getting-started/2.faq.md deleted file mode 100644 index 07c19cac..00000000 --- a/content/nuxt-seo/1.getting-started/2.faq.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 'FAQ' -description: 'Frequently asked questions about Nuxt SEO.' ---- - -Have a question about Nuxt SEO? Check out the frequently asked questions below or -[Jump in the Discord](https://discord.com/invite/5jDAMswWwX) and ask me directly! - -## Can I just use the modules separately? - -Yes! Nuxt SEO is designed to be flexible and work however you need it to. - -## Why does my production build go up so much? - -Nuxt SEO includes many features that only run on the server. These server-side features can increase the size of your -production build by a few megabytes, but won't affect the performance of your site as the modules are lazy loaded. - -If the production build size is a concern, you can disable the modules you don't need. The OG Image module -contributes the most significant amount, you can disable it with `ogImage: { enabled: false }`. - -## What happened To Nuxt SEO Kit? - -The Nuxt SEO Kit module was the initial version of Nuxt SEO. - -While it generally worked great for some users, it was only useful for server-side generated Nuxt Sites and in turn its feature -set was much more limited. - -It has been deprecated in favour of the new Nuxt SEO module. - -See the [migration guide](/nuxt-seo/migration-guide/nuxt-seo-kit) for more information. diff --git a/content/nuxt-seo/1.getting-started/3.stackblitz.md b/content/nuxt-seo/1.getting-started/3.stackblitz.md deleted file mode 100644 index 0bb4bfbd..00000000 --- a/content/nuxt-seo/1.getting-started/3.stackblitz.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "Reproductions: StackBlitz" -description: Create minimal reproductions for Nuxt SEO or just experiment with the module. ---- - -You can use the Nuxt SEO StackBlitz playgrounds for either: - -- Playing around with the module in a sandbox environment -- Making reproductions for issues (Learn more about [Why Reproductions are Required](https://antfu.me/posts/why-reproductions-are-required)) - -## StackBlitz Playgrounds - -- [Basic](https://stackblitz.com/edit/nuxt-starter-gfrej6?file=nuxt.config.ts) diff --git a/content/nuxt-seo/1.getting-started/_dir.yml b/content/nuxt-seo/1.getting-started/_dir.yml deleted file mode 100644 index bcd2ba14..00000000 --- a/content/nuxt-seo/1.getting-started/_dir.yml +++ /dev/null @@ -1 +0,0 @@ -title: Getting Started diff --git a/content/nuxt-seo/2.guides/0.using-the-modules.md b/content/nuxt-seo/2.guides/0.using-the-modules.md deleted file mode 100644 index 440b6c75..00000000 --- a/content/nuxt-seo/2.guides/0.using-the-modules.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: Using The Modules -description: How to use the different modules when using Nuxt SEO. ---- - -## Module Features - -As a minimum before you can use any of the modules, you need to [set up your site config](/nuxt-seo/guides/configuring-modules). - -### Nuxt SEO Module - -A collection of SEO features that don't fit anywhere else. - -- Automatic [default meta](/nuxt-seo/guides/default-meta) for your site. -- Automatic [fallback title](/nuxt-seo/guides/fallback-title) for your site. -- Opt-in [breadcrumbs](/nuxt-seo/api/breadcrumbs) with Schema.org support - -### Sitemap - -Automatically generates a sitemap for your site - -- When prerendering or using static only routes, no config is needed, it will automatically generate a sitemap for you. -- If you have dynamic routes, you'll need to set up a handler for [Dynamic URLs](/sitemap/guides/dynamic-urls). - -### Robots - -Automatically generates a robots.txt, `X-Robots` and robot meta tags for your site. - -- If you have any other environments besides development and production, you need to configure the `env` option. See the [Disabling Indexing](/robots/guides/disable-indexing) guide for more information. -- By default, all routes are allowed for all user-agents. See [Disabling Page Indexing](/robots/guides/disable-page-indexing) to start blocking routes. - -### OG Image - -Generate dynamic Open Graph images for your pages. - -- Opt-in, by default, it won't do anything unless you configure it. -- See the [Tutorial: Getting Familiar With Nuxt OG Image](/og-image/getting-started/getting-familar-with-nuxt-og-image) docs on setting it up. - -Note: If you don't intend to generate dynamic images, it's recommended to [disable this module](#disabling-modules). - -### Schema.org - -Automatically generates schema.org JSON-LD for your pages. - -- Provides [default Schema.org](/schema-org/guides/default-schema-org) for your pages. -- It's recommended to [set up an Identity](/schema-org/guides/quick-setup) for your site as well. -- You can opt in to more Schema.org using [useSchemaOrg](/schema-org/guides/full-documentation). - -### Link Checker - -Checks all links for issues that may be affecting your SEO. - -- When building your site it will check links -- You can also run it manually by opening the "Link Checker" tab in Nuxt DevTools - -### SEO Experiments - -A few extra SEO Nuxt features that don't fit anywhere else. - -- See the [SEO Experiments Features](/experiments/getting-started/features) guide for more information. -- Automatic File Metadata [Icons](/experiments/guides/app-icons) and [Open Graph Images](/experiments/guides/open-graph-images) -- Opt in [seoMeta](/experiments/guides/nuxt-config-seo-meta) in your nuxt.config and route rules - -## Disabling Modules - -Since Nuxt SEO installs and enables modules for you, you may run into a situation where you want to disable a module. - -The modules have these config keys: - -- `nuxt-og-image` - `ogImage` -- `@nuxtjs/sitemap` - `sitemap` -- `@nuxtjs/robots` - `robots` -- `nuxt-seo-experiments` - `seoExperiments` -- `nuxt-schema-org` - `schemaOrg` -- `nuxt-link-checker` - `linkChecker` - -You can disable any of these modules by setting the module's `enabled` value to `false` in your `nuxt.config.ts` file. - -```ts twoslash [nuxt.config.ts] -export default defineNuxtConfig({ - ogImage: { - enabled: false - }, - sitemap: { - enabled: false - }, - robots: { - enabled: false - }, - seoExperiments: { - enabled: false - }, - schemaOrg: { - enabled: false - }, - linkChecker: { - enabled: false - } -}) -``` - -### Keeping workers under 1mb - -If you are using Nuxt SEO in a serverless environment, you may want to keep your workers under 1mb. The module that -will contribute the most to your worker size is `nuxt-og-image`. - -If you are not using `ogImage`, you can disable it, otherwise consider prerendering your images. diff --git a/content/nuxt-seo/2.guides/1.configuring-modules.md b/content/nuxt-seo/2.guides/1.configuring-modules.md deleted file mode 100644 index f5e7e09f..00000000 --- a/content/nuxt-seo/2.guides/1.configuring-modules.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: Configuring Site Config -description: Configure all Nuxt SEO modules in one place using Nuxt Site Config. ---- - -[Nuxt Site Config](/site-config) allows you to configure all Nuxt SEO modules at build time and runtime. Allowing you to powerfully configure -all modules at runtime, for example in a multi-tenant or i18n app. - -It's recommended to set the following config: - -- `url` - The canonical URL of your site, avoids duplicate content and consolidates page rank. -- `name` - The name of your site, used in the title and meta tags. -- `description` - The description of your site, used in the meta tags. -- `defaultLocale` - The default locale of your site, used in the meta tags. (you can omit this if you're using `@nuxtjs/i18n`) - -```ts twoslash [nuxt.config.ts] -export default defineNuxtConfig({ - site: { - url: 'https://example.com', - name: 'Awesome Site', - description: 'Welcome to my awesome site!', - defaultLocale: 'en', // not needed if you have @nuxtjs/i18n installed - } -}) -``` - -## Preview / Staging / Testing Environments - -If you have non-production sites, such as staging or testing, you will need to configure these environments separately. - -Learn how by reading the [Disabling Indexing](/robots/guides/disable-indexing) guide. - -## Runtime Site Config - -In some cases, your site config becomes a bit more complex and you will need to generate it at runtime. - -Learn how to by following the [Runtime Site Config](/site-config/guides/runtime-site-config) guide. diff --git a/content/nuxt-seo/2.guides/4.i18n.md b/content/nuxt-seo/2.guides/4.i18n.md deleted file mode 100644 index ef331a44..00000000 --- a/content/nuxt-seo/2.guides/4.i18n.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: I18n -description: Nuxt SEO is built with full support for the I18n module. ---- - -Each module has dedicated documentation for I18n support. - -## I18n Site Config - -You can dynamically set the site config based on the current locale. - -This is useful for setting the `url` and `name` properties based on the page the user is currently on. - -See [I18n Site Config](/site-config/integrations/i18n) for more information. - -## I18n Sitemap - -The sitemap module will automatically generate a sitemap for each locale. - -See [I18n Sitemap](/sitemap/integrations/i18n) for more information. - -## I18n Robots - -Any `Disallow` rules in the robots module will automatically have the locale prefixes added. - -See [I18n Robots](/robots/integrations/i18n) for more information. diff --git a/content/nuxt-seo/2.guides/_dir.yml b/content/nuxt-seo/2.guides/_dir.yml deleted file mode 100644 index 4233b230..00000000 --- a/content/nuxt-seo/2.guides/_dir.yml +++ /dev/null @@ -1 +0,0 @@ -title: Setup Guides diff --git a/content/nuxt-seo/2.seo-guides/2.title-templates.md b/content/nuxt-seo/2.seo-guides/2.title-templates.md deleted file mode 100644 index 71af30f9..00000000 --- a/content/nuxt-seo/2.seo-guides/2.title-templates.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: Title Templates -description: How to make the most of the title templating engine from Unhead. ---- - -The default title template for your site is equivalent to: - -```ts twoslash -useHead({ - titleTemplate: '%s %separator %siteName' -}) -``` - -## Template Params - -These tokens that are prefixed with `%` are making use of [Template Params](https://unhead.unjs.io/usage/guides/template-params). - -The following tokens are available out-of-the-box: - -- `%siteName` - The name of your site. -- `%siteUrl` - The canonical URL of your site. -- `%s` or `%pageTitle` - The page title, without the template -- `%separator` - Special token used to separate parts of your title. These have special behaviour in that -they will be logically removed when it makes sense. See [Separator](https://unhead.unjs.io/usage/guides/template-params#separator) for more details. - -These tokens are available not only for the title, but also: - -- `meta: [ { content: '%site.url/my-url.png' } ]` -- `script: [ { type: 'application/json', content: { title: '%s' } } ]` - -## Changing Template Params And Separator - -To modify the template params you can provide them through nuxt.config or `useHead`. - -For example, if you'd like to change the separator (the default is `|`), you can provide the runtime config. - -::code-group - -```ts twoslash [nuxt.config.ts] -export default defineNuxtConfig({ - app: { - head: { - templateParams: { - separator: '-' - // other common separators: '·', '—', '•' - } - } - }, -}) -``` - -```vue twoslash [app.vue] - -``` - -:: - -## Changing Title Template - -If you need to modify the default `titleTemplate`, it's recommended to do it through nuxt.config. - -```ts twoslash [nuxt.config.ts] -export default defineNuxtConfig({ - app: { - head: { - titleTemplate: '%s %separator %siteName' - } - } -}) -``` - -Likewise if you'd like to use a different template for a subset of pages, you can use `useHead`. - -```vue twoslash [pages/blog/tutorials/how-to-use-titles.vue] - -``` diff --git a/content/nuxt-seo/2.seo-guides/_dir.yml b/content/nuxt-seo/2.seo-guides/_dir.yml deleted file mode 100644 index 9a0e8509..00000000 --- a/content/nuxt-seo/2.seo-guides/_dir.yml +++ /dev/null @@ -1 +0,0 @@ -title: SEO Guides diff --git a/content/nuxt-seo/3.api/4.breadcrumbs.md b/content/nuxt-seo/3.api/4.breadcrumbs.md deleted file mode 100644 index 5df417cc..00000000 --- a/content/nuxt-seo/3.api/4.breadcrumbs.md +++ /dev/null @@ -1,179 +0,0 @@ ---- -title: useBreadcrumbItems() -description: A Breadcrumb composable used to display a breadcrumb list that helps users to navigate between pages. ---- - -The `useBreadcrumbItems()` composable is a way to generate an automatic breadcrumb list that helps users to navigate between pages. - -- Integrates with [Nuxt Schema.org](/schema-org/getting-started/installation) to generate [BreadcrumbList](https://schema.org/BreadcrumbList) structured data. -- Integrates with [Nuxt I18n](https://i18n.nuxtjs.org/) to generate localized breadcrumbs. - -## Demo - -::tab-comparison - -:BreadcrumbNuxtUiExample{label="Nuxt UI"} - -:BreadcrumbRawExample{label="Headless"} - -:: - -## Modifying Breadcrumbs - -Because the breadcrumb is generated automatically, you may need to modify the final output. - -It's important to do this within the `defineBreadcrumbItems` function, as it will ensure that the Schema.org is generated correctly. - -### Route Meta - -If you need to modify the breadcrumb for a specific static route, you can use the `breadcrumb` property of the route meta. - -```vue twoslash [Page Meta] - -``` - -### Overrides - -When you need more control over the final output, you can use the `overrides` prop. This allows -you to override any part of the breadcrumb. - -The property takes an array of either: `BreadcrumbItem`, `false` or `undefined`, the array -of overrides is applied in the order they are provided. - -When providing `undefined`, nothing will be overridden. When providing `false`, the breadcrumb -will be removed. - -For example, if you have the path `/blog/my-post` and you want to override the `my-post` segment, we need -to target the third item in the array. - -```ts twoslash -// path: /blog/my-post will generate ['Home', 'Blog', 'My Post'] -useBreadcrumbItems({ - overrides: [ - undefined, // Home - undefined, // Blog - { - label: 'My Awesome Post', - to: '/blog/my-post', - icon: 'i-heroicons-home' - } - ] -}) -``` - -### `append` and `prepend` - -If you need to add items to the end or beginning of the breadcrumb, you can use the `append` and `prepend` props. - -```ts twoslash -import { useBreadcrumbItems } from '#imports' - -useBreadcrumbItems({ - append: [ - { - label: 'Final Link' - } - ] -}) -``` - -### I18n Integration - -If you're using the [@nuxtjs/i18n](https://i18n.nuxtjs.org/) module, you can use the key `breadcrumbs.items.${routeName}`. - -Where `routeName` is the generated name of the Vue Router route. - -::code-group - -```ts [en.ts] -export default { - breadcrumb: { - items: { - index: { - icon: 'i-heroicons-home', - ariaLabel: 'Home' - } - } - } -} -``` - -```json [en.json] -{ - "breadcrumb": { - "items": { - "index": { - "icon": "i-heroicons-home", - "ariaLabel": "Home" - } - } - } -} -``` - -:: - -## Props - -### `path` - -- Type: `string` -- Default: `getRoute().path` - -The path to generate the breadcrumb for. - -### `schemaOrg` - -- Type: `boolean` -- Default: `false` - -Whether to generate [BreadcrumbList](https://schema.org/BreadcrumbList) structured data. - -### `ariaLabel` - -- Type: `string` -- Default: `'Breadcrumbs'` - -The Aria Label for the breadcrumbs. - -### `hideRoot` - -- Type: `MaybeRefOrGetter` -- Default: `false` - -Whether the root breadcrumb should be shown. - -### `hideCurrent` - -- Type: `MaybeRefOrGetter` -- Default: `false` - -Whether the current breadcrumb should be shown. This is usually the last item in the breadcrumb, but not always. - -### `overrides` - -- Type: `(BreadcrumbItem | false | undefined)[]` -- Default: `[]` - -An array of items to override the generated breadcrumbs with. - -### `append` - -- Type: `BreadcrumbItem[]` -- Default: `[]` - -An array of items to append to the generated breadcrumbs. - -### `prepend` - -- Type: `BreadcrumbItem[]` -- Default: `[]` - -An array of items to prepend to the generated breadcrumbs. diff --git a/content/nuxt-seo/3.api/9.config.md b/content/nuxt-seo/3.api/9.config.md deleted file mode 100644 index 03b385d6..00000000 --- a/content/nuxt-seo/3.api/9.config.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Nuxt Config -description: Configure the sitemap module. ---- - -## `redirectToCanonicalSiteUrl` - -- Type: `boolean` -- Default: `false` - -When enabled, it will redirect any request to the canonical domain (site url) using a 301 redirect on non-dev environments. - -E.g if the site url is 'www.example.com' and the user visits 'example.com', -they will be redirected to 'www.example.com'. - -This is useful for SEO as it prevents duplicate content and consolidates page rank. - -## `automaticDefaults` - -- Type: `boolean` -- Default: `true` - -Will set up a number of defaults for meta tags and Schema.org, if the modules and config are available. - -## `splash` - -- Type: `boolean` -- Default: `true` - -When enabled, it will generate a splash message when Nuxt is started. - -## `enabled` - -- Type: `boolean` -- Default: `true` - -Whether Schema.org should be enabled or not. - -## `debug` - -- Type: `boolean` -- Default: `false` - -Enable to see debug logs. diff --git a/content/nuxt-seo/3.api/_breadcrumb-nuxt-ui.md b/content/nuxt-seo/3.api/_breadcrumb-nuxt-ui.md deleted file mode 100644 index 38c8a935..00000000 --- a/content/nuxt-seo/3.api/_breadcrumb-nuxt-ui.md +++ /dev/null @@ -1,9 +0,0 @@ -```vue [components/Breadcrumbs.vue] - - - -``` diff --git a/content/nuxt-seo/3.api/_breadcrumb-raw.md b/content/nuxt-seo/3.api/_breadcrumb-raw.md deleted file mode 100644 index c3fa0852..00000000 --- a/content/nuxt-seo/3.api/_breadcrumb-raw.md +++ /dev/null @@ -1,17 +0,0 @@ -```vue [components/Breadcrumbs.vue] - - - -``` diff --git a/content/nuxt-seo/3.api/_dir.yml b/content/nuxt-seo/3.api/_dir.yml deleted file mode 100644 index 91864357..00000000 --- a/content/nuxt-seo/3.api/_dir.yml +++ /dev/null @@ -1 +0,0 @@ -title: Nuxt API diff --git a/content/nuxt-seo/4.releases/_dir.yml b/content/nuxt-seo/4.releases/_dir.yml deleted file mode 100644 index 21e6ce54..00000000 --- a/content/nuxt-seo/4.releases/_dir.yml +++ /dev/null @@ -1 +0,0 @@ -title: Releases diff --git a/content/nuxt-seo/6.migration-guide/_dir.yml b/content/nuxt-seo/6.migration-guide/_dir.yml deleted file mode 100644 index 143efa11..00000000 --- a/content/nuxt-seo/6.migration-guide/_dir.yml +++ /dev/null @@ -1 +0,0 @@ -title: Migration Guide diff --git a/content/nuxt-seo/_dir.yml b/content/nuxt-seo/_dir.yml deleted file mode 100644 index 387ed2c1..00000000 --- a/content/nuxt-seo/_dir.yml +++ /dev/null @@ -1 +0,0 @@ -title: Nuxt SEO diff --git a/docs/app/app.config.ts b/docs/app/app.config.ts index 43149729..d059b3d3 100644 --- a/docs/app/app.config.ts +++ b/docs/app/app.config.ts @@ -5,7 +5,7 @@ export default defineAppConfig({ duration: 5000, }, theme: { - radius: 0.1, + radius: 0.25, }, ui: { colors: { diff --git a/docs/app/app.vue b/docs/app/app.vue index 731d7c26..de0e4ea1 100644 --- a/docs/app/app.vue +++ b/docs/app/app.vue @@ -1,15 +1,11 @@ - - diff --git a/docs/app/components/Header.vue b/docs/app/components/Header.vue index bfb99a3e..c91744b9 100644 --- a/docs/app/components/Header.vue +++ b/docs/app/components/Header.vue @@ -1,22 +1,152 @@ diff --git a/docs/app/components/HeaderLinks.vue b/docs/app/components/HeaderLinks.vue deleted file mode 100644 index 7d00d8bc..00000000 --- a/docs/app/components/HeaderLinks.vue +++ /dev/null @@ -1,324 +0,0 @@ - - - diff --git a/docs/app/components/HeaderLinksOld.vue b/docs/app/components/HeaderLinksOld.vue deleted file mode 100644 index 785cbd2c..00000000 --- a/docs/app/components/HeaderLinksOld.vue +++ /dev/null @@ -1,371 +0,0 @@ - - - diff --git a/docs/app/components/HomeSectionContributors.vue b/docs/app/components/HomeSectionContributors.vue deleted file mode 100644 index 74530283..00000000 --- a/docs/app/components/HomeSectionContributors.vue +++ /dev/null @@ -1,122 +0,0 @@ - - - - - diff --git a/docs/app/components/Dock.vue b/docs/app/components/Inspira/Dock.vue similarity index 84% rename from docs/app/components/Dock.vue rename to docs/app/components/Inspira/Dock.vue index bd814adb..3f254977 100644 --- a/docs/app/components/Dock.vue +++ b/docs/app/components/Inspira/Dock.vue @@ -20,7 +20,7 @@ const props = defineProps({ }, }) -const dockRef = ref(null) +const dockRef = useTemplateRef('dockRef') const mouseX = ref(Infinity) const mouseY = ref(Infinity) @@ -37,15 +37,19 @@ function onMouseMove(e: MouseEvent) { }) } -function onMouseLeave() { - mouseX.value = Infinity - mouseY.value = Infinity -} - provide('mouseY', mouseY) provide('mouseX', mouseX) provide('magnification', props.magnification) provide('distance', props.distance) + +const { isOutside } = useMouseInElement(dockRef) + +watch(isOutside, (val) => { + if (val) { + mouseX.value = Infinity + mouseY.value = Infinity + } +})