Socket
Socket
Sign inDemoInstall

parcel-transformer-meta-image

Package Overview
Dependencies
103
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    parcel-transformer-meta-image

Set absolute URL for various image meta tags.(for parcel version >= 2.0.0)


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

parcel-transformer-meta-image

npm version

Set absolute URL for og:image meta tags by parcel ver >= 2.0.0.

Inspired by lukechilds/parcel-plugin-ogimage

Install

$ npm install -D parcel-transformer-meta-image

Create .parcelrc file and paste:

{
  "extends": "@parcel/config-default",
  "transformers": { "*.html": ["...", "parcel-transformer-meta-image"] }
}

Usage

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

You must have both og:image, twitter:image, and og:url meta tags:

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

Parcel will generate that into something like this:

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

parcel-plugin-image-meta will then update the og:image with an absolute URL:

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

LICENSE

MIT

Keywords

FAQs

Last updated on 04 Mar 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc