Coder Social home page Coder Social logo

whiteabelincoln / gatsby-transformer-remark-frontmatter Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 4.0 725 KB

Allows querying frontmatter fields as markdown with gatsby

Shell 9.46% TypeScript 77.50% Nix 2.93% JavaScript 9.74% CSS 0.36%
gatsby-plugin gatsbyjs markdown

gatsby-transformer-remark-frontmatter's People

Contributors

whiteabelincoln avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gatsby-transformer-remark-frontmatter's Issues

"list" widgets are not present in fields.frontmattermd

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)"
      ]
    }
  ]
}

null page creation with netlify CMS starter

I have tried using this plugin with netlify-templates/gatsby-starter-netlify-cms, and it causes Gatsby to create a "null" page, which fails.

  1. Checkout https://github.com/aidalgol/gatsby-starter-netlify-cms/tree/transformer-remark
  2. Run npm install
  3. Run npm run develop
  4. Observe error
 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"
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.