Experimental features for Nuxt SEO / head management.

nuxt-seo-experiments

NPM versionNPM DownloadsGitHub stars

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 and src 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 yarn
yarn 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 a favicon.ico in your public directory, it will automatically infer the favicon meta tag.

seoOptimise

  • Type: boolean
  • Default: true
    Automatically optimise meta tags for SEO.
    It will automatically infer the og:title, og:description when a title and description are set respectively. It will ensure a twitter:card is set to summary_large_image if not set.
    This will do more in the future.

Sponsors

License

MIT License © 2022-PRESENT Harlan Wilton