whiteabelincoln / gatsby-transformer-remark-frontmatter Goto Github PK
View Code? Open in Web Editor NEWAllows querying frontmatter fields as markdown with gatsby
Allows querying frontmatter fields as markdown with gatsby
Does this plugin work with list widgets? They are not available in fields for me. Is there a work-around for this?
For example, in the below .md file, servicesHeader is present in fields.frontmattermd, but not serviceList.
---
servicesHeader: A services header
serviceList:
- service:
serviceCopy: >-
Some copy
serviceName: A Service Name
- service:
serviceCopy: >-
More Copy
serviceName: Another service
---
The query:
{
allFile(filter: {sourceInstanceName: {eq: "content"}, name: {eq: "services"}}) {
edges {
node {
childMarkdownRemark {
fields {
frontmattermd {
serviceList {
htmlAst
}
servicesHeader {
htmlAst
}
}
}
frontmatter {
servicesTest
servicesHeader
serviceList {
service {
serviceName
serviceCopy
}
}
}
}
}
}
}
}
... produces error:
{
"errors": [
{
"message": "Cannot query field \"serviceList\" on type \"MarkdownRemarkFieldsFrontmattermd\". Did you mean \"servicesHeader\"?",
"locations": [
{
"line": 8,
"column": 15
}
],
"stack": [
"GraphQLError: Cannot query field \"serviceList\" on type \"MarkdownRemarkFieldsFrontmattermd\". Did you mean \"servicesHeader\"?",
" at Object.Field (/Users/auser/project/node_modules/graphql/validation/rules/FieldsOnCorrectType.js:53:31)",
" at Object.enter (/Users/auser/project/node_modules/graphql/language/visitor.js:324:29)",
" at Object.enter (/Users/auser/project/node_modules/graphql/language/visitor.js:375:25)",
" at visit (/Users/project/auser/node_modules/graphql/language/visitor.js:242:26)",
" at validate (/Users/auser/project/node_modules/graphql/validation/validate.js:73:24)",
" at getGraphQLParams.then.then.optionsData (/Users/auser/project/node_modules/express-graphql/index.js:121:32)",
" at processTicksAndRejections (internal/process/next_tick.js:81:5)"
]
}
]
}
I have tried using this plugin with netlify-templates/gatsby-starter-netlify-cms, and it causes Gatsby to create a "null" page, which fails.
npm install
npm run develop
ERROR #11325
Your site's "gatsby-node.js" created a page with a component that doesn't exist.
The path to the missing component is "/path/to/gatsby-starter-netlify-cms/src/templates/null.js"
The page object passed to createPage:
{
"path": "/",
"tags": null,
"component": "/path/to/gatsby-starter-netlify-cms/src/templates/null.js",
"context": {
"id": "e4bc4da5-3e9a-564d-947c-ff26fe2e4c3c"
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.