@phntms/react-share
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -34,2 +34,4 @@ "use strict"; | ||
var pageUrl = pagePath ? baseSiteUrl + "/" + pagePath : baseSiteUrl; | ||
var image = imageUrl && | ||
(is_absolute_url_1.default(imageUrl) ? imageUrl : baseSiteUrl + "/" + imageUrl); | ||
var metaEmbed = [ | ||
@@ -45,3 +47,3 @@ react_1.default.createElement("title", { key: "title" }, title), | ||
react_1.default.createElement("meta", { key: "og:description", property: "og:description", content: description }), | ||
react_1.default.createElement("meta", { key: "og:image", property: "og:image", content: imageUrl }), | ||
react_1.default.createElement("meta", { key: "og:image", property: "og:image", content: image }), | ||
react_1.default.createElement("meta", { key: "og:image:alt", property: "og:image:alt", content: imageAlt }), | ||
@@ -48,0 +50,0 @@ react_1.default.createElement("meta", { key: "og:site_name", property: "og:site_name", content: siteTitle }), |
{ | ||
"name": "@phntms/react-share", | ||
"description": "An all-in-one React library to implement custom Sharing Meta and Social Media Sharing Buttons.", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "lib/index.js", | ||
@@ -74,2 +74,2 @@ "types": "lib/index.d.ts", | ||
} | ||
} | ||
} |
@@ -62,17 +62,17 @@ # react-share | ||
| Property | Type | Required | Notes | | ||
| ----------------- | -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| **render** | React.ReactNode | **Yes** | Unfortunately `react-helmet` and `next/head` are strict with how they accept meta tags. `react-helmet` doesn't support nesting. Whereas Next.JS only supports some children and not all, therefore a render function is required. | | ||
| **pageTitle** | string | **Yes** | Every page should have a unique title that describes the page, such as 'Home', 'About' etc. | | ||
| **siteTitle** | string | **Yes** | Title of the site, usually the organization / brand name. | | ||
| **titleTemplate** | string | **No** | Title template used to display `pageTitle` and `siteTitle` in a template, displays the values using corresponding `[pageTitle]` and `[siteTitle]`. Example template: "[pageTitle] | [siteTitle]". | | ||
| **description** | string | **Yes** | A one to two sentence description of your webpage. Keep it within 160 characters, and write it to catch the user's attention. | | ||
| **baseSiteUrl** | string | **Yes** | Base site URL, excluding trailing slash. | | ||
| **pagePath** | string | **No** | The path of the current page, excluding leading slash. | | ||
| **canonicalUrl** | string | **No** | The canonical URL, if your page is a duplicate. | | ||
| **keywords** | string|string[] | **No** | List of SEO keywords describing what your webpage does. Example, `"your, tags"` or `["your", "tags"]`. | | ||
| **imageUrl** | string | **Yes** | Image url of asset to share. Recommended aspect ratio for landscape is 1.9:1 (1200x630) or for squares 1:1 (1200x1200). For more info, visit [here](https://iamturns.com/open-graph-image-size/). | | ||
| **imageAlt** | string | **Yes** | Image alt for users who are visually impaired. | | ||
| **locale** | string | **No** | The locale these tags are marked up in, such as; `en_GB`, `fr_FR` and `es_ES`. Defaults to `en_US`. | | ||
| **twitter** | TwitterEmbedProps | **No** | Optional twitter embed properties to include. | | ||
| Property | Type | Required | Notes | | ||
| ----------------- | -------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| **render** | React.ReactNode | **Yes** | Unfortunately `react-helmet` and `next/head` are strict with how they accept meta tags. `react-helmet` doesn't support nesting. Whereas Next.JS only supports some children and not all, therefore a render function is required. | | ||
| **pageTitle** | string | **Yes** | Every page should have a unique title that describes the page, such as 'Home', 'About' etc. | | ||
| **siteTitle** | string | **Yes** | Title of the site, usually the organization / brand name. | | ||
| **titleTemplate** | string | **No** | Title template used to display `pageTitle` and `siteTitle` in a template, displays the values using corresponding `[pageTitle]` and `[siteTitle]`. Example template: "[pageTitle] | [siteTitle]". | | ||
| **description** | string | **Yes** | A one to two sentence description of your webpage. Keep it within 160 characters, and write it to catch the user's attention. | | ||
| **baseSiteUrl** | string | **Yes** | Base site URL, excluding trailing slash. | | ||
| **pagePath** | string | **No** | The path of the current page, excluding leading slash. | | ||
| **canonicalUrl** | string | **No** | The canonical URL, if your page is a duplicate. | | ||
| **keywords** | string|string[] | **No** | List of SEO keywords describing what your webpage does. Example, `"your, tags"` or `["your", "tags"]`. | | ||
| **imageUrl** | string | **Yes** | Image url of asset to share. Recommended aspect ratio for landscape is 1.9:1 (1200x630) or for squares 1:1 (1200x1200). For more info, visit [here](https://iamturns.com/open-graph-image-size/). If a relative URL is provided, `baseSiteUrl` is prefixed. If specifying a relative URL do not add the leading slash. | | ||
| **imageAlt** | string | **Yes** | Image alt for users who are visually impaired. | | ||
| **locale** | string | **No** | The locale these tags are marked up in, such as; `en_GB`, `fr_FR` and `es_ES`. Defaults to `en_US`. | | ||
| **twitter** | TwitterEmbedProps | **No** | Optional twitter embed properties to include. | | ||
@@ -79,0 +79,0 @@ To use simply add `MetaHeadEmbed` to a shared layout to get the best out of page specific properties such as `pagePath`. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69649
752