Skip to content

Commit

Permalink
feat(gatsby-transformer-remark): Note about gray-matter (#10718)
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts authored and pieh committed Dec 31, 2018
1 parent 43f56fc commit 0e84ff3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/gatsby-transformer-remark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,25 @@ It's also possible to ask Gatsby to return excerpts formatted as HTML. You might
}
```

## gray-matter options

`gatsby-transformer-remark` uses [gray-matter](https://github.com/jonschlinkert/gray-matter) to parse markdown frontmatter, so you can specify any of the options mentioned [here](https://github.com/jonschlinkert/gray-matter#options) in the `gatsby-config.js` file.

### Example: Excerpts

If you don't want to use `pruneLength` for excerpts but a custom seperator, you can specify an `excerpt_separator`:

```javascript
{
"resolve": `gatsby-transformer-remark`,
"options": {
"excerpt_separator": `<!-- end -->`
}
}
```

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

## Troubleshooting

### Excerpts for non-latin languages
Expand Down

0 comments on commit 0e84ff3

Please sign in to comment.