https://github.com/cometkim/gatsby-plugin-dedupe-head
A GatsbyJS plugin to omit duplicated elements in the `<head>`
https://github.com/cometkim/gatsby-plugin-dedupe-head
Last synced: about 1 year ago
JSON representation
A GatsbyJS plugin to omit duplicated elements in the `<head>`
- Host: GitHub
- URL: https://github.com/cometkim/gatsby-plugin-dedupe-head
- Owner: cometkim
- License: mit
- Created: 2023-04-12T08:08:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-23T04:37:50.000Z (over 1 year ago)
- Last Synced: 2024-10-23T11:12:13.221Z (over 1 year ago)
- Language: TypeScript
- Size: 2.51 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gatsby-plugin-dedupe-head
[](https://www.npmjs.com/package/gatsby-plugin-dedupe-head)
[](#license)
A GatsbyJS plugin to omit duplicated elements in the ``.
This plugin **only affects the rendered HTML content**, enough for SEO purpose.
## List of properties to handle
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](https://github.com/cometkim/gatsby-plugin-dedupe-head/issues/new).
## Usage
```js
{
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.
## LICENSE
MIT