Skip to content

Commit e17499c

Browse files
authored
Merge pull request #83 from holidayextras/renderMethod
Pass 'dataSource' as props down for repos using Prismic as source
2 parents 16f24f5 + e24cf86 commit e17499c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@holidayextras/static-site-generator",
3-
"version": "9.0.0",
3+
"version": "9.1.0",
44
"description": "Holiday Extras Static Site Generator in metalsmith / react",
55
"repository": {
66
"type": "git",
@@ -43,10 +43,10 @@
4343
"@babel/preset-env": "^7.2.0",
4444
"@babel/preset-react": "^7.0.0",
4545
"debug": "^2.2.0",
46-
"react": "^16.6.0",
47-
"react-dom": "^16.6.0",
46+
"react": "16.14.0",
47+
"react-dom": "16.14.0",
4848
"react-redux": "^5.0.6",
49-
"redux": "^3.7.2",
49+
"redux": "^4.2.0",
5050
"standard": "^16.0.4",
5151
"webpack": "^4.23.1",
5252
"webpack-cli": "^3.1.0"

src/getPrismicContent.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const getPrismicContent = () => {
1+
const getPrismicContent = (coreParams) => {
2+
const opts = Object.assign({ }, coreParams)
23
return (files, metalsmith, done) => {
34
// Adjusts the pageData from prismic to return the value of the fragment instead of the whole entity
45
const getFragmentValues = (fragment, file, data) => {
@@ -25,6 +26,7 @@ const getPrismicContent = () => {
2526
}
2627

2728
Object.keys(files).forEach(file => {
29+
files[file].dataSource = opts.dataSource
2830
files[file].pageData = files[file].prismic.page.results[0].data
2931
files[file].pagename = file
3032
getPrismicData(files[file].pageData, file)

0 commit comments

Comments
 (0)