gatsby-source-datocms
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,1 +0,4 @@ | ||
// no-op | ||
import React from 'react'; | ||
import Helmet from 'react-helmet'; | ||
export const HelmetDatoCms = ({ record }) => React.createElement(Helmet, null, record.seoMetaTags.map((item, i) => React.createElement(item.tagName, Object.assign({ key: i }, item.attributes), item.content))); |
{ | ||
"name": "gatsby-source-datocms", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Gatsby source plugin for building websites using DatoCMS as data source", | ||
@@ -27,3 +27,7 @@ "main": "index.js", | ||
"author": "DatoCMS <support@datocms.com>", | ||
"license": "ISC" | ||
"license": "ISC", | ||
"peerDependencies": { | ||
"react": "16.2.0", | ||
"react-helmet": "5.2.0" | ||
} | ||
} |
@@ -65,3 +65,3 @@ # gatsby-source-datocms | ||
{ | ||
allDatoCmsBlogPost(sort: { fields: publicationDate, order: DESC }, limit: 5) { | ||
allDatoCmsBlogPost(sort: { fields: [publicationDate], order: DESC }, limit: 5) { | ||
edges { | ||
@@ -182,2 +182,37 @@ node { | ||
This package exposes a `HelmetDatoCms` component to make it easier use these information with Helmet: | ||
```js | ||
import React from 'react' | ||
import Link from 'gatsby-link' | ||
import { HelmetDatoCms } from 'gatsby-source-datocms' | ||
const About = ({ data }) => ( | ||
<article className="sheet"> | ||
<HelmetDatoCms record={data.datoCmsAboutPage} /> | ||
<h1>{data.datoCmsAboutPage.title}</h1> | ||
<p>{data.datoCmsAboutPage.subtitle}</p> | ||
</article> | ||
) | ||
export default About; | ||
export const query = graphql` | ||
query AboutQuery { | ||
datoCmsAboutPage { | ||
seoMetaTags { | ||
tagName | ||
attributes { | ||
property | ||
content | ||
name | ||
} | ||
content | ||
} | ||
title | ||
subtitle | ||
} | ||
} | ||
``` | ||
### Tree-like collections | ||
@@ -184,0 +219,0 @@ |
@@ -27,2 +27,1 @@ const { SiteClient } = require('datocms-client'); | ||
} | ||
@@ -1,1 +0,16 @@ | ||
// no-op | ||
import React from 'react' | ||
import Helmet from 'react-helmet' | ||
export const HelmetDatoCms = ({ record }) => ( | ||
React.createElement( | ||
Helmet, | ||
null, | ||
record.seoMetaTags.map((item, i) => | ||
React.createElement( | ||
item.tagName, | ||
Object.assign({ key: i }, item.attributes), | ||
item.content | ||
) | ||
) | ||
) | ||
) |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
84776
480
276
2
6