vuepress-plugin-schema

0.1.2 • Public • Published

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.

Package Sidebar

Install

npm i vuepress-plugin-schema

Weekly Downloads

2

Version

0.1.2

License

MIT

Unpacked Size

8.48 kB

Total Files

13

Last publish

Collaborators

  • ladamczyk