Skip to content

Commit

Permalink
Run format
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Sep 19, 2017
1 parent a4a5091 commit 7945bc5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 deletions.
10 changes: 6 additions & 4 deletions examples/using-mongodb/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ module.exports = {
plugins: [
{
resolve: `gatsby-source-mongodb`,
options: { dbName: `cloud`, collection: `documents`,
server: { address: `ds143532.mlab.com`, port: 43532 },
auth: { user: `admin`, password: `12345` },
map: { documents: { description: `text/markdown`} }
options: {
dbName: `cloud`,
collection: `documents`,
server: { address: `ds143532.mlab.com`, port: 43532 },
auth: { user: `admin`, password: `12345` },
map: { documents: { description: `text/markdown` } },
},
},
`gatsby-plugin-react-helmet`,
Expand Down
2 changes: 0 additions & 2 deletions examples/using-wordpress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
"gatsby-plugin-typography": "^1.7.9",
"gatsby-source-wordpress": "^2.0.0",
"gatsby-transformer-sharp": "^1.6.5",
"hedron": "^0.7.1",
"lodash": "^4.16.4",
"react-icons": "^2.2.5",
"striptags": "^3.0.1",
"typography-theme-wordpress-2013": "^0.15.10"
},
"keywords": [
Expand Down
12 changes: 4 additions & 8 deletions examples/using-wordpress/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class Home extends Component {
<div>
<div style={{ marginBottom: rhythm(1) }}>
<h1>Pages</h1>
{data.allWordpressPage.edges.map(({ node }) => {
return (
{data.allWordpressPage.edges.map(({ node }) => (
<div key={node.slug}>
<Link to={node.slug} style={{ textDecoration: `none` }}>
<h3>{node.title}</h3>
Expand All @@ -33,22 +32,19 @@ class Home extends Component {
{node.date}
</span>
</div>
)
})}
))}
</div>
<hr />
<h1>Posts</h1>
{data.allWordpressPost.edges.map(({ node }) => {
return (
{data.allWordpressPost.edges.map(({ node }) => (
<div style={{ marginBottom: rhythm(2) }} key={node.slug}>
<Link to={node.slug} style={{ textDecoration: `none` }}>
<h3>{node.title}</h3>
</Link>
<div dangerouslySetInnerHTML={{ __html: node.excerpt }} />
<PostIcons node={node} />
</div>
)
})}
))}
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = ({ url, store, cache, createNode }) =>
let responseError = false
const responseStream = got.stream(url, { headers })
responseStream.pipe(fs.createWriteStream(tmpFilename))
responseStream.on("downloadProgress", pro => console.log(pro))
responseStream.on(`downloadProgress`, pro => console.log(pro))

// If there's a 400/500 response or other error.
responseStream.on(`error`, (error, body, response) => {
Expand Down
6 changes: 2 additions & 4 deletions packages/gatsby-source-wordpress/src/normalize.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const crypto = require(`crypto`)
const deepMapKeys = require(`deep-map-keys`)
const _ = require(`lodash`)
const uuidv5 = require("uuid/v5")
const uuidv5 = require(`uuid/v5`)
const { createRemoteFileNode } = require(`gatsby-source-filesystem`)

const colorized = require(`./output-color`)
Expand Down Expand Up @@ -205,8 +205,7 @@ exports.mapPostsToTagsCategories = entities => {
}

// TODO generalize this for all taxonomy types.
exports.mapTagsCategoriesToTaxonomies = entities => {
return entities.map(e => {
exports.mapTagsCategoriesToTaxonomies = entities => entities.map(e => {
// Where should api_menus stuff link to?
if (e.taxonomy && e.__type !== `wordpress__wp_api_menus_menus`) {
// Replace taxonomy with a link to the taxonomy node.
Expand All @@ -215,7 +214,6 @@ exports.mapTagsCategoriesToTaxonomies = entities => {
}
return e
})
}

exports.mapEntitiesToMedia = entities => {
const media = entities.filter(e => e.__type === `wordpress__wp_media`)
Expand Down

0 comments on commit 7945bc5

Please sign in to comment.