gatsby-plugin-clean-canonical-urls
v1.0.0
Published
Add canonical links to HTML pages Gatsby generates.
Downloads
2
Readme
gatsby-plugin-clean-canonical-urls
Add canonical links to HTML pages Gatsby generates.
This implementation is primarily helpful for distinguishing between https/http, www/no-www but could possibly be extended to help with when sites add multiple paths to the same page.
Install
npm install --save gatsby-plugin-clean-canonical-urls
How to use
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-plugin-clean-canonical-urls`,
options: {
siteUrl: `https://www.example.com`,
},
},
]
With the above configuration, the plugin will add to the head of every HTML page
a rel=canonical
e.g.
<link rel="canonical" href="https://www.example.com/about-us/" />