Community Plugin
View plugin on GitHubDescription
This is NOT a replacement of the official gatsby-transformer-remark
plugin. It just creates a new graphql field plainText
on every MarkdownRemark node using the strip-markdown
remark plugin.
plainText
will contain simple paragraphs without formatting. Alt text will be used to replace images.
Dependencies
Gatsby 2.x
How to install
$ npm install --save gatsby-transformer-remark-plaintext
When do I use this plugin?
You might find it useful for creating JSON-LD for Structured Data or other meta based on your markdown sources.
Examples of usage
In gatsby-config.js
after gatsby-transformer-remark
:
plugins: [
`gatsby-transformer-remark`,
`gatsby-transformer-remark-plaintext`,
]
Restart $ gatsby develop
.
Now you can add the plainText
field to your queries.
How to query for data
{
allMarkdownRemark(
limit: 10
) {
edges {
node {
frontmatter {
title
}
html
plainText
}
}
}
}