Repository: garmeeh/next-seo
Pull request #41 (2019-02-17 22:04:29)

Fix link issue with Article
Due to both OpenGraph and JSON-LD having `Article` links when you click the article link in JSON-LD it routes to the Open Graph `Article`. This slight update fixes the issue.


Patch:
diff --git a/.all-contributorsrc b/.all-contributorsrc
index a952943..66f84db 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -62,6 +62,17 @@
         "example",
         "doc"
       ]
+    },
+    {
+      "login": "Ktchan825",
+      "name": "Ktchan825",
+      "avatar_url": "https://avatars3.githubusercontent.com/u/20606631?v=4",
+      "profile": "https://github.com/Ktchan825",
+      "contributions": [
+        "test",
+        "code"
+      ]
     }
-  ]
+  ],
+  "contributorsPerLine": 7
 }
diff --git a/README.md b/README.md
index da3019f..108bc82 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # Next SEO
 
-[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors)
+[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors)
 
 Next SEO is a plug in that makes managing your SEO easier in Next.js projects and is compatible with version`6.0.0`+ of Next.js.
 
@@ -570,7 +570,7 @@ Google has excellent content on JSON-LD -> [HERE](https://developers.google.com/
 
 Below you will find a very basic page implementing each of the available JSON-LD types:
 
-- [Article](#article)
+- [Article](#article-1)
 - [Breadcrumb](#breadcrumb)
 - [Blog](#blog)
 - [Course](#course)
@@ -971,9 +971,8 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
 
 <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
 <!-- prettier-ignore -->
-| [<img src="https://avatars1.githubusercontent.com/u/13333582?v=4" width="100px;"/><br /><sub><b>Gary Meehan</b></sub>](https://www.garymeehan.ie/)<br />[💻](https://github.com/garmeeh/next-seo/commits?author=garmeeh "Code") [📖](https://github.com/garmeeh/next-seo/commits?author=garmeeh "Documentation") [💡](#example-garmeeh "Examples") [⚠️](https://github.com/garmeeh/next-seo/commits?author=garmeeh "Tests") | [<img src="https://avatars3.githubusercontent.com/u/3099369?v=4" width="100px;"/><br /><sub><b>Jerome Fitzgerald</b></sub>](https://www.jeromefitzgerald.com/)<br />[💻](https://github.com/garmeeh/next-seo/commits?author=JeromeFitz "Code") | [<img src="https://avatars0.githubusercontent.com/u/3820632?v=4" width="100px;"/><br /><sub><b>erick B</b></sub>](https://github.com/erickeno)<br />[💻](https://github.com/garmeeh/next-seo/commits?author=erickeno "Code") | [<img src="https://avatars2.githubusercontent.com/u/15269328?v=4" width="100px;"/><br /><sub><b>Erik Condie</b></sub>](https://www.erikcondie.com)<br />[💻](https://github.com/garmeeh/next-seo/commits?author=econdie "Code") [⚠️](https://github.com/garmeeh/next-seo/commits?author=econdie "Tests") [💡](#example-econdie "Examples") [🤔](#ideas-econdie "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/168870?v=4" width="100px;"/><br /><sub><b>Tim Reynolds</b></sub>](http://timothyreynolds.co.uk)<br />[💻](https://github.com/garmeeh/next-seo/commits?author=timReynolds "Code") [⚠️](https://github.com/garmeeh/next-seo/commits?author=timReynolds "Tests") [💡](#example-timReynolds "Examples") [📖](https://github.com/garmeeh/next-seo/commits?author=timReynolds "Documentation") |
-| :---: | :---: | :---: | :---: | :---: |
-
+| [<img src="https://avatars1.githubusercontent.com/u/13333582?v=4" width="100px;" alt="Gary Meehan"/><br /><sub><b>Gary Meehan</b></sub>](https://www.garymeehan.ie/)<br />[💻](https://github.com/garmeeh/next-seo/commits?author=garmeeh "Code") [📖](https://github.com/garmeeh/next-seo/commits?author=garmeeh "Documentation") [💡](#example-garmeeh "Examples") [⚠️](https://github.com/garmeeh/next-seo/commits?author=garmeeh "Tests") | [<img src="https://avatars3.githubusercontent.com/u/3099369?v=4" width="100px;" alt="Jerome Fitzgerald"/><br /><sub><b>Jerome Fitzgerald</b></sub>](https://www.jeromefitzgerald.com/)<br />[💻](https://github.com/garmeeh/next-seo/commits?author=JeromeFitz "Code") | [<img src="https://avatars0.githubusercontent.com/u/3820632?v=4" width="100px;" alt="erick B"/><br /><sub><b>erick B</b></sub>](https://github.com/erickeno)<br />[💻](https://github.com/garmeeh/next-seo/commits?author=erickeno "Code") | [<img src="https://avatars2.githubusercontent.com/u/15269328?v=4" width="100px;" alt="Erik Condie"/><br /><sub><b>Erik Condie</b></sub>](https://www.erikcondie.com)<br />[💻](https://github.com/garmeeh/next-seo/commits?author=econdie "Code") [⚠️](https://github.com/garmeeh/next-seo/commits?author=econdie "Tests") [💡](#example-econdie "Examples") [🤔](#ideas-econdie "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/168870?v=4" width="100px;" alt="Tim Reynolds"/><br /><sub><b>Tim Reynolds</b></sub>](http://timothyreynolds.co.uk)<br />[💻](https://github.com/garmeeh/next-seo/commits?author=timReynolds "Code") [⚠️](https://github.com/garmeeh/next-seo/commits?author=timReynolds "Tests") [💡](#example-timReynolds "Examples") [📖](https://github.com/garmeeh/next-seo/commits?author=timReynolds "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/20606631?v=4" width="100px;" alt="Ktchan825"/><br /><sub><b>Ktchan825</b></sub>](https://github.com/Ktchan825)<br />[⚠️](https://github.com/garmeeh/next-seo/commits?author=Ktchan825 "Tests") [💻](https://github.com/garmeeh/next-seo/commits?author=Ktchan825 "Code") |
+| :---: | :---: | :---: | :---: | :---: | :---: |
 <!-- ALL-CONTRIBUTORS-LIST:END -->
 
 This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
diff --git a/src/meta/buildTags.jsx b/src/meta/buildTags.jsx
index 6ed7114..3a74954 100644
--- a/src/meta/buildTags.jsx
+++ b/src/meta/buildTags.jsx
@@ -101,7 +101,7 @@ const buildTags = config => {
       tagsToRender.push(
         <meta
           key="fb:app_id"
-          name="fb:app_id"
+          property="fb:app_id"
           content={config.facebook.appId}
         />,
       );


Test patch:
diff --git a/e2e/cypress/e2e/seo.spec.js b/e2e/cypress/e2e/seo.spec.js
index 4c0190f..b902fa8 100644
--- a/e2e/cypress/e2e/seo.spec.js
+++ b/e2e/cypress/e2e/seo.spec.js
@@ -96,7 +96,7 @@ describe('SEO Meta', () => {
       'content',
       'SiteName A',
     );
-    cy.get('head meta[name="fb:app_id"]').should(
+    cy.get('head meta[property="fb:app_id"]').should(
       'have.attr',
       'content',
       '1234567890',
@@ -214,7 +214,7 @@ describe('SEO Meta', () => {
       'content',
       'SiteName B',
     );
-    cy.get('head meta[name="fb:app_id"]').should(
+    cy.get('head meta[property="fb:app_id"]').should(
       'have.attr',
       'content',
       '987654321',
diff --git a/src/meta/__tests__/__snapshots__/buildTags.spec.jsx.snap b/src/meta/__tests__/__snapshots__/buildTags.spec.jsx.snap
index 5faedf9..565ef93 100644
--- a/src/meta/__tests__/__snapshots__/buildTags.spec.jsx.snap
+++ b/src/meta/__tests__/__snapshots__/buildTags.spec.jsx.snap
@@ -355,7 +355,7 @@ exports[`renders correctly 1`] = `
   />
   <meta
     content="1234567890"
-    name="fb:app_id"
+    property="fb:app_id"
   />
   <meta
     content="https://www.url.ie"
diff --git a/src/meta/__tests__/buildTags.spec.jsx b/src/meta/__tests__/buildTags.spec.jsx
index e2e31c8..4a29c9d 100644
--- a/src/meta/__tests__/buildTags.spec.jsx
+++ b/src/meta/__tests__/buildTags.spec.jsx
@@ -64,7 +64,7 @@ it('returns full array for default seo object', () => {
   const twitterCard = container.querySelectorAll(
     'meta[content="summary_large_image"]',
   );
-  const facebookAppId = container.querySelectorAll('meta[name="fb:app_id"]');
+  const facebookAppId = container.querySelectorAll('meta[property="fb:app_id"]');
   const twitterCardTag = container.querySelectorAll(
     'meta[name="twitter:card"]',
   );