I am figuring out how to bring an excerpt into my site, using the Contentful Rich Text React Renderer.
I am struggling a little this is the first time I am using it. I have used MD in the past with contentful, but due to users i require rich test.
This is my query.
export const query = graphql`
query($slug: String!) {
contentfulJobListings(slug: { eq: $slug }) {
jobTitle
jobPostedDate(formatString: "MMMM Do, YYYY")
jobSalaryN
jobLocation
jobDescription {
json
}
}
}
`
and this is how i am i producing the rich text on the page <div>{documentToReactComponents(props.data.contentfulJobListings.jobDescription.json)}</div>
I would like to create an excerpt to explain a little before jumping into the post.
If anyone could help with this that would be great. As im at a loose end.