You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Luke Childs 1966dc7050 1.1.0 6 years ago
.gitignore Initial commit 6 years ago
.travis.yml Initial commit 6 years ago
LICENSE Initial commit 6 years ago
README.md Add usage instructions 6 years ago
index.js Remove uneeded escape chars 6 years ago
package.json 1.1.0 6 years ago

README.md

parcel-plugin-ogimage

Set absolute URL for og:image meta tags.

Build Status npm

Sets absolute URLs for og:image meta tags. This is required by the spec and relative URLs will not work on some sites such as 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 meta tag to convert og:image to absolute URL.

Install

npm install parcel-plugin-ogimage

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 meta tags:

<meta property="og: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="og:url" content="https://example.com">

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

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

License

MIT © Luke Childs