parcel-transformer-meta-image
v1.0.4
Published
Set absolute URL for various image meta tags.(for parcel version >= 2.0.0)
Downloads
7
Readme
parcel-transformer-meta-image
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