Skip to content

limdongjin/vuepress-plugin-simple-seo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vuepress-plugin-simple-seo

Simple Seo plugin for Vuepress 1.x

npm version MIT License

Install

yarn add -D @limdongjin/vuepress-plugin-simple-seo

Usage

module.exports = {
    plugins:  ['@limdongjin/vuepress-plugin-simple-seo', {
        // write options. ( all options are optional )
    }]
}

Example Usage1

// config.js
module.exports = {
    plugins:  ['@limdongjin/vuepress-plugin-simple-seo', {
          default_image: '/images/main-image-min.jpg',
          root_url: 'https://limdongjin.github.io',
          default_site_name: 'limdongjin TIL'
    }]
}
---
description: It is Simple Seo Plugin for Vuepress
image: '/post-specific-image.png'
twitter_creator: twituser
twitter_site: twituser
---

# It is automatic title.

hello world

## gogo
<!-- result html head tags-->
<meta property="og:image" content="https://limdongjin.github.io/images/main-image-min.jpg">
<meta name="twitter:image" content="https://limdongjin.github.io/images/main-image-min.jpg">

<meta property="og:description" content="It is Simple Seo Plugin for Vuepress">
<meta name="twitter:description" content="It is Simple Seo Plugin for Vuepress">
<meta itemprop="description" content="It is Simple Seo Plugin for Vuepress">

<meta property="og:url" content="https://limdongjin.github.io/">
<meta name="twitter:url" content="https://limdongjin.github.io/">

<meta property="og:title" content="It is automatic title">
<meta name="twitter:title" content="It is automatic title">
<meta itemprop="name" content="It is automatic title">

<meta property="og:type" content="article"> <!-- default value -->
<meta name="twitter:card" content="summary"> <!-- default value -->

<meta property="og:site_name" content="limdongjin TIL">

<meta name="twitter:site" content="@twituser">
<meta name="twitter:creator" content="@twituser">

Options

  • recommend option are also "optional" option.
  • Type: string

root_url (recommend)

  • Default: Empty String
  • Example: https://limdongjin.github.io
<meta property="og:url" content="https://limdongjin.github.io/">
<meta name="twitter:url" content="https://limdongjin.github.io/">

default_site_name (recommend)

  • Default: undefined
<meta property="og:site_name" content="limdongjin TIL">

default_image (recommend)

  • Default: undefined
  • Example, /image.png
<meta name="og:image" content="https://mysite.com/image.png">
<meta name="twitter:image" content="https://mysite.com/image.png">
<meta itemprop="image" content="https://mysite.com/image.png">

default_image_type

  • Default: undefined
<meta name="og:image:type" content="image/jpeg">

default_image_width

  • Default: undefined
<meta name="og:image:width" content="400">

default_image_height

  • Default: undefined
<meta name="og:image:height" content="500">

default_image_alt

  • Default: undefined
<meta name="og:image:alt" content="it is alt!">

default_twitter_creator

  • Default: undefined
<meta name="twitter:creator" content="@limdongjin">

default_twitter_site

  • Default: undefined
<meta name="twitter:site" content="@limdongjin">

default_twitter_card

  • Default: summary
<meta name="twitter:card" content="summary">

default_og_type

  • Default: article
<meta property="og:type" content="website">

Frontmatter

  • each page can override default option values.
  • if you want minimal setting, recommend just set description, or image.

title

if you are not write frontmatter title, create meta title tag from $page.title.

<meta property="og:title" content="awesome title">
<meta name="twitter:title" content="Dongjin Lim, 초고수 소프트웨어 엔지니어를 향하여">

description ( recommend )

<meta property="og:description" content="write your page description">
<meta name="twitter:description" content="write your page description">
<meta name="description" content="write your page description">
<meta itemprop="description" content="write your page description">

image ( recommend )

 <meta name="og:image" content="https://mysite.com/image.png">
 <meta name="twitter:image" content="https://mysite.com/image.png">
 <meta itemprop="image" content="https://mysite.com/image.png">

image_type

<meta name="og:image:type" content="image/jpeg">

image_width

<meta name="og:image:width" content="400">

image_height

<meta name="og:image:height" content="500">

image_alt

<meta name="og:image:alt" content="it is alt!">

twitter_creator

  • Example: twituser
<meta name="twitter:creator" content="@twituser">

twitter_site

  • Example: twituser
<meta name="twitter:site" content="@twituser">

twitter_card

<meta name="twitter:card" content="summary">

og_type

<meta property="og:type" content="website">

site_name

<meta property="og:site_name" content="limdongjin TIL">

License

MIT © limdongjin