New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@layflags/parcel-plugin-metaimage

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@layflags/parcel-plugin-metaimage

Set absolute url for og:image and twitter:image meta tags.

  • 1.2.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

parcel-plugin-metaimage

Set absolute URL for all og:image and twitter:image meta tags.

This plugin is based on Luke Childs, nothingrandom and Eliepse code.

Sets absolute URLs for all og:image and twitter:image meta tags. This is required by the spec and relative URLs will not work on some sites such as Facebook or Twitter.

You can fix this directly in parcel by using --public-url https://example.com, however now all your URLs are hardcoded to absolute URLs which may be undesirable and can break things like prerendering.

This plugin uses the value of the og:url (or non-standard origin) meta tag to convert og:image to an absolute URL.

Install

npm install @layflags/parcel-plugin-metaimage

Usage

Just install this package as a development dependency. Parcel will automatically call it when building your application.

You must have both og:image and og:url (or origin) meta tags:

<meta name="twitter:image" content="card.png">
<meta property="og:image" content="card.png">
<meta property="og:url" content="https://example.com">

Parcel will generate that into something like this:

<meta name="twitter:image" content="/card.9190ce93.png">
<meta property="og:image" content="/card.9190ce93.png">
<meta property="og:url" content="https://example.com">

@layflags/parcel-plugin-metaimage will then update the og:image and twitter:image with an absolute URL:

<meta name="twitter:image" content="https://example.com/card.9190ce93.png">
<meta property="og:image" content="https://example.com/card.9190ce93.png">
<meta property="og:url" content="https://example.com">

License

MIT @ layflags

From Luke Childs and nothingrandom and Eliepse code

Keywords

FAQs

Package last updated on 01 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc