No description, website, or topics provided.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist dist added back Feb 22, 2019
lib new line Jan 28, 2019
.babelrc Transpiler added Feb 22, 2019
.eslintrc Fixes babel and adds linter Jan 21, 2019
.gitignore dist added back Feb 22, 2019
.travis.yml Updated travis test Jan 28, 2019
LICENSE Meta builder package started Jan 21, 2019
README.md Updated the readme Jan 30, 2019
package.json browserlist changed to array Feb 22, 2019
yarn.lock Transpiler added Feb 22, 2019

README.md

Nuxt Meta Builder

NPM version Build Status Dependency Status

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

Why?

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.

Installation

yarn add @netsells/nuxt-meta-builder

Usage

<script>
    // Pull the plugin in
    import Meta from '@netsells/nuxt-meta-builder';
    
    export default {
        // Basic usage
        head() {
            return (new Meta)
                .setTitle('My page title')
                .setDescription('The description for the current page')
                .make();
        },       
    };
</script>

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.

License

MIT © Netsells