An Interest In:
Web News this Week
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
- March 14, 2024
- March 13, 2024
April 21, 2021 09:10 pm GMT
Original Link: https://dev.to/robert96/add-meta-tags-for-social-media-with-htmlwebpackplugin-21h2
Add meta tags for social media with HtmlWebpackPlugin
Social media meta tags are <meta>
tags in the <head>
of your web page that control how URLs
are displayed when shared on social media.
If you are using webpack
you can use the meta
option from the HtmlWebpackPlugin
to add the
social meta meta tags to your web page:
// webpack.config.js// ... new HtmlWebpackPlugin({ meta: { 'description': { name: 'description', contnet: '...' }, 'keyword': { name: 'keywords', content: '...' }, 'og:title': { property: 'og:title', content: '...' }, 'og:description': { property: 'og:description', content: '...' }, 'og:type': { property: 'og:type', content: 'website' }, 'og:url': { property: 'og:url', content: '...' }, 'og:image': { property: 'og:image', content: '...' }, 'twitter:card': { name: 'twitter:card', content: 'summary_large_image' }, 'twitter:title': { name: 'twitter:title', content: '...' }, 'twitter:description': { name: 'twitter:description', content: '...' }, 'twitter:image': { name: 'twitter:image', content: '...' } }})// ...
Original Link: https://dev.to/robert96/add-meta-tags-for-social-media-with-htmlwebpackplugin-21h2
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To