Nuxt SEO
SEO / HTML Meta Tags Module for Nuxt.js
Installation
Module available through the
npm registry. It can be installed using the
npm
or
yarn
command line tools.
npm install nuxt-seo --save
yarn add nuxt-seo
Documentation
Setup
- Add
nuxt-seo
to modules
section of your nuxt.config.js
{
modules: [
'nuxt-seo'
],
seo: {
name: '<name of site>',
title: '<title default>',
description: '<description default'
}
}
Module options
name
- Default:
false
- Type: String
charset
- Default:
utf-8
- Type: String
title
- Default:
TITLE
- Type: String
lang
language
- Default:
English
- Type: String
image
- Default:
false
- Type: URL String
description
- Default:
false
- Type: String
keywords
- Default:
[]
- Type: Array[...keywords] || String
type
author
- Default:
false
- Type: Array[name, email || site] || String
url
- Default:
false
- Type: URL String
Vue Context
asyncData: function({ seo }) { seo(options) }
<template>
<h1>Hello World</h1>
</template>
<script>
export default {
asyncData: function(ctx) {
ctx.seo({
title: 'Home Page',
description: 'Hello World Page'
})
},
head: {
//title: 'Home Page'
}
}
</script>
Tests
To run the test suite, first install the dependencies, then run test
:
npm test
yarn test
Dependencies
- debug: small debugging utility
Dev Dependencies
- ava: Testing can be a drag. AVA helps you get it done.
- nuxt: A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)
- vue: Reactive, component-oriented view layer for modern web interfaces.
Contributors
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. List of all contributors.
License
MIT © Tiago Danin