Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plugins not running gatsby-browser.js #4329

Merged
merged 4 commits into from
Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/using-remark/src/layouts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from "react"
import Link from "gatsby-link"
import { rhythm, scale } from "../utils/typography"
import styles from "../styles"
import presets from "../utils/presets"

import "typeface-space-mono"
import "typeface-spectral"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tags:
}
```

You can also manually mark in your markdown where to stop excerpting—similar to Jekyl. `gatsby-transformer-remark` uses [gray-matter]() to parse markdown frontmatter, so you can specify an excerpt_separator, as well as any of the other options mentioned [here](), in the `gatsby-config.js` file.
You can also manually mark in your markdown where to stop excerpting—similar to Jekyl. `gatsby-transformer-remark` uses [gray-matter](https://github.com/jonschlinkert/gray-matter) to parse markdown frontmatter, so you can specify an `excerpt_separator`, as well as any of the other options mentioned [here](https://github.com/jonschlinkert/gray-matter#options), in the `gatsby-config.js` file.

```json
{
Expand All @@ -33,6 +33,6 @@ You can also manually mark in your markdown where to stop excerpting—similar t
}
```

Any file that does not have the given excerpt_separator will fall back to the default pruning method.
Any file that does not have the given `excerpt_separator` will fall back to the default pruning method.

You can see the results [here](/excerpt-example)
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ author: Daisy Buchanan

This example uses a custom excerpt_separator.

You can manually mark in your markdown where to stop excerpting—similar to Jekyl. `gatsby-transformer-remark` uses [gray-matter]() to parse markdown frontmatter, so you can specify an excerpt_separator, as well as any of the other options mentioned [here](), in the `gatsby-config.js` file.
You can manually mark in your markdown where to stop excerpting—similar to Jekyll. <!-- end -->`gatsby-transformer-remark` uses [gray-matter](https://github.com/jonschlinkert/gray-matter) to parse markdown frontmatter, so you can specify an `excerpt_separator`, as well as any of the other options mentioned [here](https://github.com/jonschlinkert/gray-matter#options), in the `gatsby-config.js` file.

<!-- end -->

```json
{
Expand All @@ -20,4 +19,4 @@ You can manually mark in your markdown where to stop excerpting—similar to Jek
}
```

Any file that does not have the given excerpt_separator will fall back to the default pruning method.
Any file that does not have the given `excerpt_separator` will fall back to the default pruning method.
2 changes: 1 addition & 1 deletion examples/using-remark/src/templates/template-blog-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import rehypeReact from "rehype-react"

import styles from "../styles"
import { rhythm, scale } from "../utils/typography"
import presets from "../utils/presets"
import Counter from "../components/Counter"

import "katex/dist/katex.min.css"
Expand Down Expand Up @@ -99,6 +98,7 @@ class BlogPostRoute extends React.Component {
marginRight: rhythm(3 / 4),
marginBottom: 0,
}}
Tag="span"
/>
<span
css={{
Expand Down
8 changes: 5 additions & 3 deletions packages/gatsby-plugin-catch-links/src/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { navigateTo } from "gatsby-link"

import catchLinks from "./catch-links"

catchLinks(window, href => {
navigateTo(href)
})
exports.onClientEntry = () => {
catchLinks(window, href => {
navigateTo(href)
})
}
8 changes: 5 additions & 3 deletions packages/gatsby-plugin-typography/src/gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import typography from "gatsby-plugin-typography/.cache/typography.js"

// Hot reload typography in development.
if (process.env.NODE_ENV !== `production`) {
typography.injectStyles()
exports.onClientEntry = () => {
// Hot reload typography in development.
if (process.env.NODE_ENV !== `production`) {
typography.injectStyles()
}
}