1.0.0 • Published 4 years ago

gridsome-plugin-netlify-redirects v1.0.0

Weekly downloads
-
License
MPL-2.0
Repository
gitlab
Last release
4 years ago

Gridsome plugin Netlify redirects

Create redirects for Netlify while building the website.

Install

npm i --save gridsome-plugin-netlify-redirects

Setup

{
  use: 'gridsome-plugin-netlify-redirects',
  options: {
    typeName: 'NetlifyRedirects',
    redirects: [
      {
        from: '/blog'
        to: '/store'
        status: 302
      },
      {
        from: '/home'
        to: '/store'
        status: 302
      }
    ]
  }
}

You can add more redirects during build to the collection you've defined in the typeName option. Redirects are nodes of the NetlifyRedirects collection by default. You can add nodes using the Gridsome API to the collection while building the website to add more redirects.