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

[gatsby-plugin-remark] Get the whole content without HTML and Markdown #5357

Closed
Destroy666x opened this issue May 10, 2018 · 4 comments
Closed
Labels
help wanted Issue with a clear description that the community can help with.

Comments

@Destroy666x
Copy link

Summary

As the title says, I see no way to get Markdown content without HTML or Markdown (including frontmatter), I didn't find a custom plugin for that either. I guess you could use excerpt with an enormous value, but that's counterintuitive.

Basic example

internal {
  content
}

returns the whole Markdown structure including frontmatter.

html on the other hand returns HTML version of it without frontmatter.

Motivation

It supports cases such as getting content ready for e.g. indexing for search or RSS in a understandable (not "Why are you getting an excerpt with 999999 size there?") way without the need of postprocessing with JS.

@KyleAMathews
Copy link
Contributor

Where do you want this data? In you gatsby-node.js? This seems a bit niche maybe to directly support in the schema — you can just use gray-matter (which is what gatsby-transformer-remark users) to extract the body out from the frontmatter.

@KyleAMathews
Copy link
Contributor

But I suppose we could add a field like rawMarkdownBody or something which would do the transformation for you.

@Destroy666x
Copy link
Author

Destroy666x commented May 11, 2018

This seems a bit niche maybe

Well yeah, there aren't too many use cases, but IMO more than for e.g. timeToRead. And e.g. the RSS use case could appear more times in the future here since the plugin is maintained in the core.

@m-allanson m-allanson added help wanted Issue with a clear description that the community can help with. 🏷 type: feature labels May 13, 2018
@pieh
Copy link
Contributor

pieh commented Jun 6, 2018

This will be available via rawMarkdownBody thanks to #5557

@pieh pieh closed this as completed Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with.
4 participants