Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-cli-plugin-meta

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-cli-plugin-meta

Vue-cli plugin to add social media tags and other metadata to your project

  • 0.1.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

vue-cli-plugin-meta

Give your new Vue app some meta love

A Vue-cli plugin to add social media tags and other metadata to your project. Because while vue-cli 3.x lets you get started with a new project real quick, it will leave you with a rather 'barebones' index.html file. This plugin fixes that. By answering just a few questions about your project, you will benefit from:

  • A visual representation of your project when shared on Twitter, Facebook, Slack... This includes a title, description and image.
  • An automatically included link to your Twitter account or that of your client when shared by anyone on Twitter.
  • Google Analytics tracking (more providers to follow soon).

Getting started

:warning: Make sure you're working with vue-cli 3.x. Earlier versions do not support plugins such as this one:

vue --version

Create a new project if you haven't done so:

vue create my-new-app

Switch to your (new) project and add the plugin:

cd my-new-app
vue add meta

What we need to know

Well, that was the hard part. Now it's just a matter of answering a few prompts. Here's what vue-cli-plugin-meta will want to know.

  • The name of your project: used as the title of the page and when shared on social media.
  • The homepage of your published project. This needs to be a full and absolute url.
  • A description of your project, used for social media. There's no hard limit when it comes to the length of this field, but Facebook will abbreviate it depending on where your shared content is being shown.
  • A Twitter handle associated with the project. No need to include the initial @. This will be linked backed to when shared, leave blank if not applicable.
  • A link to the image that you want to show up when shared. Facebook and Twitter expect an absolute and full url here, but you'll only need to provide whatever follows the homepage url you've provided earlier.
  • The tracking ID you want to use for Google Analytics. Including UA- at the start.

Providing data through vue.config.js

If some of this data is shared across projects or you just prefer not to use the prompting system, you can always add some or all of it in the optional vue.config.js file in the root of your project. Data found there will be shown as pre-filled when you're being prompted which means you can still change it at that point or just press enter to accept it as is.

vue.config.js needs to export an object with the following structure and keys:

module.exports = {
  pluginOptions: {
    meta: {
      projectName: 'My project',
      url: 'https://example.com',
      description: 'Lorem ipsum dolor sid amet',
      twitterHandle: 'example',
      socialImage: 'images/social.jpg',
      googleAnalytics: 'UA-12345678-1'
    }
  }
}

Make sure to include the data in the same format as described above (e.g. no @ in front of the Twitter handle). Again, you can 'pre-fill' any number of prompts this way.

Keywords

FAQs

Package last updated on 22 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc