meta builder class so that you can build the meta object up in a more fluent way
Last updated a year ago by samturrell .
MIT · Original npm · Tarball · package.json
$ cnpm install @netsells/nuxt-meta-builder 
SYNC missed versions from official npm registry.

Nuxt Meta Builder

NPM version Build Status Dependency Status

A fluent approach to building up the meta data object within a Nuxt project


The standard approach to building up the meta content powered by vue-meta is to manually create an object with keys and values and is often a repeated mess across pages. This approach makes this a bit more readable via fluent methods.


yarn add @netsells/nuxt-meta-builder


Add the module to your nuxt config's modules array:

module.exports = {
    modules: [

You can then access the $metaBuilder function on the Vue instance:

    export default {
        // Basic usage
        head() {
            return this.$metaBuilder()
                .setTitle('My page title')
                .setDescription('The description for the current page')

Available API Methods

Method Description Arguments
setDescription Set both the description and the og:description meta data val [required] - the description to set
setTitle Set both the title and the og:title meta data hid - the title to set

content [optional, default = false] - the title value to set
addMeta Set specific meta values hid [required] - the unique meta tag id to set. Can be an single string or an array of strings

content [required] - the meta value to set
make Generate the resulting object None.

Note: All public API methods return the class instance and can be chained, other than the make command which returns the final meta object and should be called last.


MIT © Netsells

Current Tags

  • 2.0.0                                ...           latest (a year ago)

7 Versions

  • 2.0.0                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
Dev Dependencies (16)
Dependents (0)

Copyright 2014 - 2017 © taobao.org |