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 met…


This content originally appeared on DEV Community and was authored by Dezmerean Robert

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: '...' }
  }
})
// ...


This content originally appeared on DEV Community and was authored by Dezmerean Robert


Print Share Comment Cite Upload Translate Updates
APA

Dezmerean Robert | Sciencx (2021-04-21T21:10:42+00:00) Add meta tags for social media with HtmlWebpackPlugin. Retrieved from https://www.scien.cx/2021/04/21/add-meta-tags-for-social-media-with-htmlwebpackplugin/

MLA
" » Add meta tags for social media with HtmlWebpackPlugin." Dezmerean Robert | Sciencx - Wednesday April 21, 2021, https://www.scien.cx/2021/04/21/add-meta-tags-for-social-media-with-htmlwebpackplugin/
HARVARD
Dezmerean Robert | Sciencx Wednesday April 21, 2021 » Add meta tags for social media with HtmlWebpackPlugin., viewed ,<https://www.scien.cx/2021/04/21/add-meta-tags-for-social-media-with-htmlwebpackplugin/>
VANCOUVER
Dezmerean Robert | Sciencx - » Add meta tags for social media with HtmlWebpackPlugin. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/21/add-meta-tags-for-social-media-with-htmlwebpackplugin/
CHICAGO
" » Add meta tags for social media with HtmlWebpackPlugin." Dezmerean Robert | Sciencx - Accessed . https://www.scien.cx/2021/04/21/add-meta-tags-for-social-media-with-htmlwebpackplugin/
IEEE
" » Add meta tags for social media with HtmlWebpackPlugin." Dezmerean Robert | Sciencx [Online]. Available: https://www.scien.cx/2021/04/21/add-meta-tags-for-social-media-with-htmlwebpackplugin/. [Accessed: ]
rf:citation
» Add meta tags for social media with HtmlWebpackPlugin | Dezmerean Robert | Sciencx | https://www.scien.cx/2021/04/21/add-meta-tags-for-social-media-with-htmlwebpackplugin/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.