Author -  Sai gowtham

Vue Seo tutorial using Vue meta

In this tutorial, we are going to learn about how to make SEO friendly vue.js apps by using vue-meta package.

In single-page apps, SEO is the hard part because there is only a single html page which is resuing throughout our app.

Search engines didn’t recognize what type of content you are providing if you are using the same title and description on every page in your vue app.

There is a package called vue-meta which helps us to control the vue app meta tags.

Let’s install the package now.

npm i vue-meta

Now, we need to configure this package by adding a below code inside the main.js file.

import VueMeta from 'vue-meta'

Vue.use(VueMeta);

With this our setup is complete.

Adding SEO

Now, we can directly add seo meta tags inside our component <script> tag like this.

Example

Home.vue
<template>
  <div class="hello">
    <h1>This is Home page</h1>
  </div>
</template>

<script>
export default {
  metaInfo: {
    title: "This is Home page",    meta: [
      { name: "description", content: "Learn coding with our free tutorials" },      { name: "keywords", content: "react,vue,angular" }      //you can also add open graph tags here
    ]
  }
};
</script>

In the above code, we have added a metaInfo object which contains title property and, meta array.

title: Title of our App.

meta: Inside meta array, we can add meta description, keywords, and open graph tags, etc.

If we inspect our App in the browser it might look like this in the below image.

vue-seo-example

Css Tutorials & Demos

How rotate an image continuously in CSS

In this demo, we are going to learn about how to rotate an image continuously using the css animations.

How to create a Instagram login Page

In this demo, i will show you how to create a instagram login page using html and css.

How to create a pulse animation in CSS

In this demo, i will show you how to create a pulse animation using css.

Creating a snowfall animation using css and JavaScript

In this demo, i will show you how to create a snow fall animation using css and JavaScript.

Top Udemy Courses

JavaScript - The Complete Guide 2023 (Beginner + Advanced)
JavaScript - The Complete Guide 2023 (Beginner + Advanced)
116,648 students enrolled
52 hours of video content
$14.99 FROM UDEMY
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
631,582 students enrolled
49 hours of video content
$24.99 FROM UDEMY
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
203,937 students enrolled
31.5 hours of video content
$14.99 FROM UDEMY