0.1.2 • Published 5 years ago

vuepress-plugin-schema v0.1.2

Weekly downloads
3
License
MIT
Repository
gitlab
Last release
5 years ago

Vuepress Plugin Schema

🔌Generate structured data for Your vuepress blog

Add <script type="application/ld+json">...</script> to your vuepress site.

Install

npm i vuepress-plugin-schema -D

Usage

Read How to use vuepress Plugin first, modify your .vuepress/config.js.

module.exports = {
  plugins: [
    [
      'vuepress-plugin-schema',
      {
        baseURL: 'https://google.com', // base url for your schema, mandatory, default: ''
        title: 'My webpage', // title for your organization schema, mandatory, default: ''
        socials: [  // socials urls for your schema, default: []
            "https://www.youtube.com/channel/CHANNEL_ID",
            "https://www.facebook.com/FACEBOOK_ID/",
        ],
      }
    ]
  ]
}

Plugin uses Frontmatter settings with fallback to themeConfig for these two variables:

const author = $page.frontmatter.author || themeConfig.author; // without it we can't set WebPage and Article schema
const language = $page.frontmatter.lang || themeConfig.language; // without it we can't set Article schema

One of these needs always to be set.

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago