A GatsbyJS plugin to omit duplicated elements in the <head>
.
This plugin only affects the rendered HTML content, enough for SEO purpose.
Which tags will be de-duplicated:
title
meta[name=description]
link[rel=canonical]
meta[property=og:type]
meta[property=og:url]
meta[property=og:title]
meta[property=og:description]
meta[property=og:determiner]
meta[property=og:locale]
meta[property=fb:app_id]
meta[name=twitter:*]
This list cannot be customized yet. If you need other properties please file an issue.
{
plugins: [
// Place this to last as possible.
{
resolve: 'gatsby-plugin-dedupe-head',
options: {
strategy: 'pick_last', // default
},
},
],
}
You can choose the dedupe strategy in pick_first
or pick_last
.
pick_first
: Keep the first matched tag. Omit others.pick_last
: Keep the last matched tag. Omit others.
MIT