Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

TiagoDanin/Nuxt-SEO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nuxt SEO

Node Version Downloads Travis

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
npm install nuxt-seo --save
# Or Using Yarn
yarn add nuxt-seo

Documentation

Setup

  • Add nuxt-seo to modules section of your nuxt.config.js
{
	modules: [
		'nuxt-seo'
	],
	seo: {
		// Module options
		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

  • Default: en
  • Type: String

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
npm test
# Or Using Yarn
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