I've added a new page to the config.yml
file from the gatsby netlify started repo:
- name: "pages"
label: "Pages"
files:
- file: "src/pages/CV/index.md"
label: "CV"
name: "CV"
fields:
- {
label: "Template Key",
name: "templateKey",
widget: "hidden",
default: "cv-page",
}
- { label: "Name", name: "name", widget: "string" }
- { label: "Portrait", name: "portrait", widget: "image" }
- label: "Categories"
name: "categories"
widget: "list"
fields:
- { label: Title, name: title, widget: string }
- { label: "Body", name: "body", widget: "markdown" }
And then I query for the data in my cv-page component:
export const cvPageQuery = graphql`
query CVPage($id: String!) {
markdownRemark(id: { eq: $id }) {
frontmatter {
name
portrait
categories {
title
body
}
}
}
}
`;
now I would like gatsby-transformer-remark to parse the categories body from markdown to html - but the query is just returning a markdown string (for example body: "* one↵* two↵* three↵* four"
).
Before when I had the markdown widget directly on the page as a field, I would just query for html
outside of frontmatter
and the data would be there. Why is this not working with the widget being nested in a list?
Thanks for the help.
EDIT: repo with my code for reference