unhead
Go to documentationExperimental features for Nuxt SEO / head management.
nuxt-seo-experiments
Experimental SEO for Nuxt.
Status: Experimental Please report any issues 🐛 Made possible by my Sponsor Program 💖 Follow me @harlan_zw 🐦 • Join Discord for help |
ℹ️ Looking for a complete SEO solution? Check out Nuxt SEO Kit.
⚠️ This package was previously called nuxt-unhead. It has been renamed to nuxt-seo-experiments to better reflect the scope of the package.
Features
- ✨ Automatic social share meta tags
- 🧙 Automatic SEO tags based on public files
- 🌳 TypeScript autocompletion for tag
href
andsrc
attributes - Fix tags that need to be absolute (og:image, twitter:image)
- 📦 Infer data from package.json
- Public runtime data exposed to Template Params
NUXT_PUBLIC_SITE_TITLE=test
->title: %siteTitle
Background
This module was built to test bug fixes as well as experimental new features which may land into the Nuxt core.
Install
npm install --save-dev nuxt-seo-experiments# Using yarnyarn add --dev nuxt-seo-experiments
Setup
nuxt.config.ts
export default defineNuxtConfig({ modules: [ 'nuxt-seo-experiments', ],})
Module Configuration
Config key: seoExperiments
nuxt.config.ts
export default defineNuxtConfig({ modules: ['nuxt-seo-experiments'], seoExperiments: { // config (see below) }, //...})
Usage
Config
inferTagsFromFiles
- Type:
boolean
- Default:
true
Automatically infer meta tags from public files.
For example, if you have afavicon.ico
in yourpublic
directory, it will automatically infer thefavicon
meta tag.
seoOptimise
- Type:
boolean
- Default:
true
Automatically optimise meta tags for SEO.
It will automatically infer theog:title
,og:description
when a title and description are set respectively. It will ensure atwitter:card
is set tosummary_large_image
if not set.
This will do more in the future.
Sponsors
License
MIT License © 2022-PRESENT Harlan Wilton