Browse Source

seo 최적화 > 페이지별로 다른 seo 적용

김보경 5 years ago
parent
commit
96a151a8d6
8 changed files with 53 additions and 3 deletions
  1. 9 1
      pages/about.vue
  2. 8 0
      pages/blogs/_slug.vue
  3. 3 0
      pages/blogs/index.vue
  4. 8 0
      pages/courses/_slug.vue
  5. 9 1
      pages/courses/index.vue
  6. 9 1
      pages/cv.vue
  7. 3 0
      pages/index.vue
  8. 4 0
      static/robots.txt

+ 9 - 1
pages/about.vue

@@ -1,3 +1,11 @@
 <template>
   <h1>I am about page</h1>
-</template>
+</template>
+
+<script>
+export default {
+  head: {
+    title: 'Learn more about Nuxtjs | Nuxtjs'
+  }
+}
+</script>

+ 8 - 0
pages/blogs/_slug.vue

@@ -18,6 +18,14 @@
 import UserTile from '~/components/shared/UserTile'
 import EditorView from "~/components/editor/EditorView";
 export default {
+  head() {
+    return {
+      title: this.blog.title,
+      meta: [
+        { hid: 'description', name: 'description', content: this.blog.subtitle }
+      ]
+    }
+  },
   components: {
     UserTile,
     EditorView

+ 3 - 0
pages/blogs/index.vue

@@ -66,6 +66,9 @@
 <script>
 import { mapState } from 'vuex';
 export default {
+  head: {
+    title: 'Amazing tech blogs | Nuxtjs'
+  },
   computed: {
     ...mapState({
       publishedBlogs: state => state.blog.items.all,

+ 8 - 0
pages/courses/_slug.vue

@@ -46,6 +46,14 @@
 import ProductHero from '~/components/ProductHero'
 import ProductHeroCard from '~/components/ProductHeroCard'
 export default {
+  head() {
+    return {
+      title: this.course.title,
+      meta: [
+        { hid: 'description', name: 'description', content: this.course.subtitle }
+      ]
+    }
+  },
   components: {
     ProductHero, ProductHeroCard
   },

+ 9 - 1
pages/courses/index.vue

@@ -1,3 +1,11 @@
 <template>
   <h1>I am Courses page</h1>
-</template>
+</template>
+
+<script>
+export default {
+  head: {
+    title: 'Amazing tech courses | Nuxtjs'
+  }
+}
+</script>

+ 9 - 1
pages/cv.vue

@@ -1,3 +1,11 @@
 <template>
   <h1>I am CV page</h1>
-</template>
+</template>
+
+<script>
+export default {
+  head: {
+    title: 'CV | Nuxtjs'
+  }
+}
+</script>

+ 3 - 0
pages/index.vue

@@ -61,6 +61,9 @@ import CourseCardTooltip from '~/components/CourseCardTooltip'
 import BlogCard from "~/components/BlogCard";
 import {mapState} from "vuex"
 export default {
+  head: {
+    title: 'Online Courses and Blogs | Nuxtjs'
+  },
   components: {
     Hero, CourseCard, BlogCard,CourseCardTooltip
   },

+ 4 - 0
static/robots.txt

@@ -0,0 +1,4 @@
+User-agent *
+Disallow: /login
+Disallow: /register
+Disallow: /instructor/*