Skip to content

Commit b599aab

Browse files
committed
Merge branch 'master' into gatsby-source-medium/fetch-users-and-publications
2 parents 6507299 + f0f0040 commit b599aab

File tree

22 files changed

+118
-90
lines changed

22 files changed

+118
-90
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ Websites built with Gatsby:
138138
* [Landing page of Put.io](https://put.io/)
139139
* [Ryan Wiemer's Portfolio](https://www.ryanwiemer.com)
140140
([source](https://github.com/ryanwiemer/rw))
141+
* [yerevancoder](https://yerevancoder.com)
142+
([source](https://github.com/yerevancoder/yerevancoder.github.io))
141143

142144
## Docs
143145

docs/blog/2018-01-18-how-boston-gov-used-gatsby-to-be-selected-as-an-amazon-hq2-candidate-city/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Today, the team and the city scored a huge victory when Amazon announced that Bo
1010

1111
![Amazon Boston homepage](./amazon-boston.jpg "Boston city")
1212

13-
When Amazon announced in September that it was looking to build a new headquarters, bringing 50,000 jobs and billions of investment to the chosen city, Boston’s city government jumped to throw their hat in the ring.
13+
When Amazon announced in September that it was looking to build a new headquarters, bringing 50,000 jobs and billions of investment to the chosen city, Boston’s city government jumped to throw their hat in the ring.
1414

1515
As a technology hub, the city wanted to put their best digital foot forward, so they turned to the Boston.gov team to build a website as the city’s application — [amazon.boston.gov](http://amazon.boston.gov) .
1616

docs/docs/building-apps-with-gatsby.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Building apps with Gatsby"
33
---
44

5-
Gatsby can be used to create fully dynamic apps. The default Gatsby app is made up of statically rendered pages. On this foundation, you can build what we call "hybrid" sites which adds dynamically rendered sections of pages and if needed, client-only routes.
5+
Gatsby can be used to create fully dynamic apps. The default Gatsby app is made up of statically rendered pages. On this foundation, you can build what we call "hybrid" sites which adds dynamically rendered sections of pages and if needed, client-only routes.
66

77
## Statically rendered pages
88

docs/docs/gatsby-starters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Community:
8080
* Basic components: SiteNavi, SitePost, SitePage
8181

8282
* [gatsby-blog-starter-kit](https://github.com/dschau/gatsby-blog-starter-kit)
83-
[(demo)](https://dschau.github.io/gatsby-blog-starter-kit/)
83+
[(demo)](https://dschau.github.io/gatsby-blog-starter-kit/)
8484

8585
Features:
8686

docs/docs/querying-with-graphql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ the browser when needed by your components.
2222
## Why is GraphQL so cool?
2323

2424
* Eliminate frontend data boilerplate — no need to worry about requesting & waiting for data. Just ask for the data you need with a GraphQL query and it'll show up when you need it
25-
* Push frontend complexity into queries — many data transformations can be done at *build-time* within your GraphQL queries
25+
* Push frontend complexity into queries — many data transformations can be done at _build-time_ within your GraphQL queries
2626
* It's the perfect data querying language for the often complex/nested data dependencies of modern applications
2727
* Improve performance by removing data bloat — GraphQL is a big part of why Gatsby is so fast as it enables lazy-loading the exact data in the exact form each view needs
2828

packages/gatsby-plugin-netlify-cms/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gatsby-plugin-netlify-cms",
3-
"version": "1.0.2",
3+
"version": "1.0.4",
44
"description": "A Gatsby plugin which generates the Netlify CMS single page app",
55
"main": "index.js",
66
"author": "Shawn Erquhart <[email protected]>",
Lines changed: 58 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,70 @@
11
const HtmlWebpackPlugin = require(`html-webpack-plugin`)
22
const HtmlWebpackIncludeAssetsPlugin = require(`html-webpack-include-assets-plugin`)
3+
const ExtractTextPlugin = require(`extract-text-webpack-plugin`)
4+
5+
function plugins(stage) {
6+
const commonPlugins = [
7+
// Output /admin/index.html
8+
new HtmlWebpackPlugin({
9+
title: `Content Manager`,
10+
filename: `admin/index.html`,
11+
chunks: [`cms`],
12+
}),
13+
14+
// Include the identity widget script in the html file
15+
new HtmlWebpackIncludeAssetsPlugin({
16+
assets: [`https://identity.netlify.com/v1/netlify-identity-widget.js`],
17+
append: false,
18+
publicPath: false,
19+
}),
20+
]
321

4-
exports.modifyWebpackConfig = (
5-
{ config, stage },
6-
{ modulePath = `${__dirname}/cms.js` }
7-
) => {
822
switch (stage) {
923
case `develop`:
24+
return commonPlugins
25+
case `build-javascript`:
26+
return [...commonPlugins, new ExtractTextPlugin(`cms.css`)]
27+
default:
28+
return []
29+
}
30+
}
31+
32+
function module(config, stage) {
33+
switch (stage) {
1034
case `build-javascript`:
11-
config.merge({
12-
entry: {
13-
cms: modulePath,
14-
},
15-
plugins: [
16-
new HtmlWebpackPlugin({
17-
title: `Content Manager`,
18-
filename: `admin/index.html`,
19-
chunks: [`cms`],
20-
}),
21-
new HtmlWebpackIncludeAssetsPlugin({
22-
assets: [
23-
`https://identity.netlify.com/v1/netlify-identity-widget.js`,
24-
],
25-
append: false,
26-
publicPath: false,
27-
}),
28-
],
35+
// Exclude Netlify CMS styles from Gatsby CSS bundle. This relies on
36+
// Gatsby using webpack-configurator for webpack config extension, and
37+
// also on the target loader key being named "css" in Gatsby's webpack
38+
// config.
39+
config.loader(`css`, {
40+
exclude: [/\/node_modules\/netlify-cms\//],
41+
})
42+
43+
// Exclusively extract Netlify CMS styles to /cms.css (filename configured
44+
// above with plugin instantiation).
45+
config.loader(`cms-css`, {
46+
test: /\.css$/,
47+
include: [/\/node_modules\/netlify-cms\//],
48+
loader: ExtractTextPlugin.extract([`css`]),
2949
})
3050
return config
3151
default:
3252
return config
3353
}
3454
}
55+
56+
exports.modifyWebpackConfig = (
57+
{ config, stage },
58+
{ modulePath = `${__dirname}/cms.js` }
59+
) => {
60+
config.merge({
61+
entry: {
62+
cms: modulePath,
63+
},
64+
plugins: plugins(stage),
65+
})
66+
67+
module(config, stage)
68+
69+
return config
70+
}

packages/gatsby-remark-images/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gatsby-remark-images",
3-
"version": "1.5.37",
3+
"version": "1.5.39",
44
"description": "Processes images in markdown so they can be used in the production build.",
55
"main": "index.js",
66
"keywords": [

packages/gatsby-remark-images/src/__tests__/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,5 @@ test(`it leaves non-relative HTML img tags alone`, async () => {
144144
`.trim()
145145

146146
const nodes = await plugin(createPluginOptions(content, imagePath))
147-
148-
expect(nodes.length).toBe(0)
147+
expect(nodes[0].value).toBe(content)
149148
})

packages/gatsby-remark-images/src/index.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ module.exports = (
5252
}
5353
return null
5454
})
55+
5556
if (!imageNode || !imageNode.absolutePath) {
5657
return resolve()
5758
}
@@ -141,9 +142,12 @@ module.exports = (
141142
fileType !== `svg`
142143
) {
143144
const rawHTML = await generateImagesAndUpdateNode(node, resolve)
144-
// Replace the image node with an inline HTML node.
145-
node.type = `html`
146-
node.value = rawHTML
145+
146+
if (rawHTML) {
147+
// Replace the image node with an inline HTML node.
148+
node.type = `html`
149+
node.value = rawHTML
150+
}
147151
return resolve(node)
148152
} else {
149153
// Image isn't relative so there's nothing for us to do.
@@ -197,10 +201,13 @@ module.exports = (
197201
formattedImgTag,
198202
resolve
199203
)
200-
// Replace the image string
201-
thisImg.replaceWith(rawHTML)
202-
} else {
203-
return resolve()
204+
205+
if (rawHTML) {
206+
// Replace the image string
207+
thisImg.replaceWith(rawHTML)
208+
} else {
209+
return resolve()
210+
}
204211
}
205212
}
206213

0 commit comments

Comments
 (0)