GithubHelp home page GithubHelp logo

decaporg / gatsby-starter-decap-cms Goto Github PK

View Code? Open in Web Editor NEW
2.1K 42.0 989.0 25.59 MB

Example Gatsby + Decap CMS project

Home Page: https://gatsby-netlify-cms.netlify.app/

License: MIT License

JavaScript 93.93% Sass 6.07%
gatsby netlify-cms netlify react jamstack static-site-generator bulma cms starter-template starter

gatsby-starter-decap-cms's People

Contributors

adrianababakanian avatar austingreen avatar benaiah avatar charisewalraven avatar charliegerard avatar dependabot-preview[bot] avatar ekoeryanto avatar erezrokah avatar erquhart avatar flppv avatar freedomwriter avatar futuregerald avatar hennessyevan avatar kalinchernev avatar kyleamathews avatar marcobiedermann avatar martinjagodic avatar maxcell avatar missmatsuko avatar neo avatar rdela avatar renovate-bot avatar renovate[bot] avatar sakit0 avatar spences10 avatar talves avatar taras avatar tarehart avatar vincenavarro avatar zoltanveres avatar

Stargazers

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

Watchers

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

gatsby-starter-decap-cms's Issues

Build is failing

Hey @erquhart, any idea why the build is failing? It's failing on gatsby-netlify-cms.netlify.com and I was able to replicate it locally. Below is the error I'm getting:

error Generating JavaScript bundles failed
  Error: app-57675578fd6eed3803db.js from UglifyJs
  SyntaxError: Unexpected character '`' [./~/gatsby-plugin-netlify-cms/gatsby-browser.js:10,0]

MarkdownRemark Error

I can get this up and running on Netlify, and it works, with NetlifyCMS and all. But when I clone a clean copy to my machine, run yarn and yarn start I get this error during the process createLayouts.

GraphQLError: Cannot query field "allMarkdownRemark" on type "RootQueryType".

I think this is related to #2212, but this example project does not lack .md files. When I update the various transformers, I can maybe get past the error at that step, but it shows up later.

Any thoughts? I also tried Node 8.2.0, 8.4.0, and 9.1.11. I'd like to start from this template, but if I can't, I'll go through https://www.gatsbyjs.org/docs/netlify-cms/

Unable to proceed after npm-i with node-gyp error

On high sierra, unable to proceed after npm i since it fails with gyp ERR! configure error gyp ERR! stack Error: gypfailed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)

Question: Local development

In the readme it says

To test the CMS locally, you'll need run a production build of the site

After build and serving my site locally it promts me to enter my site url. Entering "http://localhost:9000" does not work and then I specify my live url I get redirected to it after login (which is the expected outcome).
So how do I enter the CMS backend locally?
Sorry if I miss something but I could not find the solution in this starter template.
Thanks!

The gatsby-*-sharp plugins - are they actually used?

Seems like everything keeps working fine when I simply remove them. Why are they installed then?

Also I tried to use gatsby-transformer-sharp as shown in the example in its docs, but for some reason I can't find any ImageSharp nodes in GraphiQL. Where did they go?

Select by ID instead of path

Is this something we can adjust?

#46 (comment)

For this reason and others, I recommend always just using the ID to select things. IDs are guaranteed to be unique across the site.

Or is selecting by path necessary?

Question: How to use image processing for images uploaded via Netlify CMS?

With Netlify CMS one has the possibility to define fields and UI for editing these fields which are then saved to a YAML or JSON file and uploaded to Github. Then these data files can be loaded into a Gatsby app and added to siteMetadata. One can also include fields of type image and they will then be uploaded to Github through the CMS. For example, I can have teamMembers with the field "photo" of type image. With Gatsby I can then query for them like this:

export const pageQuery = graphql`
  query TeamQuery {
    site {
      siteMetadata {
        team {
          teamMembers {
            name
            photo
          }
        }
      }
    }
  }

However, I couldn't find how to use the Gatsby's image processing capabilities in such a query
I would need to issue a different allImageSharp query for that and it is not obvious to me how to pass the respective photo src to it.

This concerns all the images uploaded via Netlify CMS, not necessarily saved as siteMetadata, since it is then more convenient not to query for them via allImageSharp, but to use respective fields in frontmatter to get to the image files.

Is there a way to somehow wrap queries for such fields (like photo above) with image processing queries in GraphQL? Or if not, what could be a reasonable way of processing images which are uploaded from Netlify CMS?

A better default for config.yml

- Do you want to request a feature or report a bug?
feature

- What is the current behavior?
I tried to add my github infos under backend in the config.yml
If you not careful or you just don't know in the beginning, you get this message quite fast:

Sorry!
There's been an error - please report it!

Error: The GitHub backend needs a "repo" in the backend configuration.

Added the backend information in my config.yml according to https://www.netlify.com/blog/2017/08/17/a-complete-cms-with-no-server-and-18-lines-of-code/

This what the tutorial says:

backend:
  name: github
  repo: erquhart/blank

this is what I did:

backend:
  name: github
  branch: heyalbert/socialimpactmag

Did you see it? branch instead of repo. Repo is, of course, correct but yeah, I had fun figuring this out.
My suggestion is to make repo the default and not branch. Repo is what you need first and not branch.

Linting to help contribution

Suggestion:
Adopt popular community configs and common linting tasks.

Why:
To help others when contributing to and integrating this project.

How:
Use eslint, prettier, stylelint, and/or an editorconfig.
Most of these have a popular community config that could be adopted.

Info:
Related: #67 #68
Semi related: #71 #74 #73
(the semi related ones would have been caught/fixed by using a standard config)

You mentioned in #57 about certain things being removed when a developer forks the project, and i agree this would fall in that category. But i think they are important when contributing to this project.

What are your thoughts?

templateKey fields should be added to config.yml

Otherwise after editing and saving in Netlify CMS the templateKey field is removed and the app doesn't build.

For blog:

  - {label: "Template", name: "templateKey", widget: "hidden", default: "blog-post" }

For about:

  - {label: "Template", name: "templateKey", widget: "hidden", default: "about-page" }

Collection" "Pages" empty on fresh install

When I do I fresh install of this through the start with a template link and I login to the new site, if I go to Colllections > Pages it says "No Entries".

According to the config.yml I think it should display about and products

Any idea whats going wrong?

(I also tried adding a new collection with a similar structure as pages and also getting "No Entries" in the admin panel.)

Can't use sharp

Hello,

I got away with the following problem by simply giving up on the sharp module, but would be curious to know if I did anything wrong, or there's a fix I could use.

Here's what I did (apologise for being a bit long):

  • I followed the Getting Started instructions, replacing yarn with npm install, then ran npm run develop
  • It failed, due to 'cannot find module sharp'
  • I then brew instal yarn (in hope that yarn may be able to build it better than npm)
  • During the yarn installation, it reported that 'The brew link step did not complete successfully. The formula built, but is not symlinked into /usr/local. Could not symlink bin/node. Target /usr/local/bin/node already exists. You may want to remove it...'. etc
  • However, the yarn installation reported no error upon completion.
  • I then ran yarn, and got '...sharp: Command failed' and 'cannot find module ...node-gyp.js'
  • I npm -v to discover npm doesn't work anymore: 'Error: Cannot find module.... unsupported.js'
  • I did brew install node and got: 'node 10.4.1 is already installed, it's just not linked. You can use brew link node to link this version'
  • So I brew link node and got yet another 'Error: Could not symlink bin/node...' etc, similarly to what it reported during the yarn installation.
  • I then uninstalled node and brew and installed them both back again.
  • When I then ran npm run develop, it reported an error referenced from sharp.node: 'library not loaded: @rpath/libvips-cpp.42.dylib'. Enclosed the screen print.
  • At this point I gave up sharp altogether and removed it from the package. Everything started working again (24 hours after I've attempted my first npm run develop...) but I'm curious if there was a fix I could use.

Thanks!

image

Can't password reset on Netlify

Hi, I've used the starter from the landing page of NetlifyCMS before and I hadn't had any issues in the past. Today I couldn't make the setup work, because the user created by the identity system can't have the password reset. It's validated, but can't be used, because I can't reach the point to make the credentials.

Like never, I have exact steps to reproduce! I started to write an article about the starter! 😃

The url of the reset link is http://suspicious-perlman-ee0a64.netlify.com/#invite_token=somehash

Netlify identity widget not displaying

In the netlifycms docs you point to for setting up authentication, it says to include the widget in the site add the script in two places, the index page at admin/index.html and in the site main index page.

In your code where would you include this widget script?

screen shot 2018-03-26 at 3 07 28 pm

Change Homepage

How can i make the products page in the example
the home page, the page when the root url visited?

Thank you.

Maintainership

Hey Austin - would you be open to adding me as a collaborator here w/ write access to help maintain?

Error when uploading image - TypeError: e.commit is undefined

When I try to upload image, I get this notification Failed to persist media: TypeError: e.commit is undefined - I am not sure if this has something to do with the image path. I haven't changed anything yet in the config file (which might be the problem) but I'm curious to know if you are familiar with the error.

Console errors:
Error: Unrecognized front-matter format. (backend.js:161:27)
TypeError: e.commit is undefined (implementation.js:139:6)
TypeError: e.commit is undefined (mediaLibrary.js:89:6)

GraphQL errors in gatsby-node get swallowed

I would add here something like this:

 result.errors.forEach(e => console.error(e.toString()))

Otherwise the errors are not printed and it's super difficult to find the cause why gatsby just stops working. Error can easily appear e.g. when querying for a field which only existed in one .md file. Once the file gets deleted, the field is also removed from GraphQL api.

gatsby-starter-netlify-cms with gatsby version 2

Gatsby-starter-netlify-cms will have opportunity to choose which version of gatsby to choose 1 or 2?
Expect that gatsby will migrate to version 2 and now only bug fixes are possible to version 1.

Using a react component library instead of plain Bulma

This is a feature proposal.
I found the current HTML of the starter template looks very messy.
I think this could be cleaned up quiet a bit by using a component library for the Bulma css frame work like bloomer and separating in-line styles to const styles = StyleSheet.create({})

(I am a bit of a coding newbie but if people like this idea I'd be happy to remake the templates in this format)

For example the product-page.js now looks like:
Instead it could look something like

<section className="section section--gradient">
    <div className="container">
      <div className="section">
        <div className="columns">
          <div className="column is-10 is-offset-1">
            <div className="content">
              <div
                className="full-width-image-container margin-top-0"
                style={{ backgroundImage: `url(${image})` }}
              >
                <h2
                  className="has-text-weight-bold is-size-1"
                  style={{
                    boxShadow: '0.5rem 0 0 #f40, -0.5rem 0 0 #f40',
                    backgroundColor: '#f40',
                    color: 'white',
                    padding: '1rem',
                  }}
                >
                  {title}
                </h2>
              </div>
/* etc.. */

But could instead look like:

<Container>
      <Section>
        <Columns>
          <Column isOffset={1} isSize={10}>
            <Content>
              <Title isSize={1}>{title}</Title>
            </Content>
          </Column>
        </Columns>
      </Section>
    </Container>

Styling not applied in NetlifyCMS editor preview

I'm not sure if this is an issue with the repo (haven't dug in enough to understand it all yet) or if NetlifyCMS just doesn't support rendering the preview of the site when using Sass.

Example:

image

Overriding Bulma variables does not work

In src/layouts/all.scss, adding, for instance $navbar-padding-horizontal: 15rem on either line 1 or 2 (or anywhere really), before or after @import "~bulma/sass/utilities/initial-variables" does nothing.

According to the Bulma docs, this should be the correct way to override Bulma variables.

2.0 status?

Wasn't clear from the closed issues regarding 2.0 if this is 2.0-ready or not yet.

WebpackError: Helmet is not defined?

I'm pretty new to Gatsby + React. I keep getting that Error on gatsby build. Tried manually reinstalling the helmet plugin, to no avail.

Thanks a ton!

Can't access admin

I followed instruction in this readme, but when I try to login with Github I got this:

VM719 component---src-pages-index-js-3ecad98b078aeb144417.js:1 Uncaught TypeError: t.handleScriptLoad is not a function
    at Object.onLoad (VM719 component---src-pages-index-js-3ecad98b078aeb144417.js:1)
    at VM719 component---src-pages-index-js-3ecad98b078aeb144417.js:1
    at VM719 component---src-pages-index-js-3ecad98b078aeb144417.js:1
    at Array.forEach (<anonymous>)
    at a (VM719 component---src-pages-index-js-3ecad98b078aeb144417.js:1)
    at HTMLScriptElement.i.onload (VM719 component---src-pages-index-js-3ecad98b078aeb144417.js:1)

I tried to debug it locally, but no matter what I do in src/pages/index.js file changes are not getting picked up or compiled.

Bitbucket problem

Maybe I'm searching wrong but I want to deploy this via Bitbucket and can't add a service so I get errors in my backend:

/.netlify/git/github/contents/src/pages/blog?ts=1523350390260&ref=master Failed to load resource: the server responded with a status of 404 ()
/.netlify/git/github/contents/static/img?ts=1523350390348&ref=master Failed to load resource: the server responded with a status of 404 ()

Is there a other way to do this?

Remove netlify CMS from the template gives build error

Hello,

I started with this template and I would like to remove the netlify-cms dependency because I don't use it. But when I do yarn remove netlify-cms and run yarn build it gives me following error

success Building CSS — 5.052 s
success Building production JavaScript bundles — 8.878 s

error Building static HTML for pages failed

See our docs page on debugging HTML builds for help https://goo.gl/yL9lND

  27 |   message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
  28 |
> 29 |   var error = new Error(message);
     | ^
  30 |   error.name = 'Invariant Violation';
  31 |   error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
  32 |

In development mode I get the error saying, expected react component to be class or function, instead got symbol.

I am trying to find out where this is coming from. Any help will be appreciated.

Derive entry paths from filenames

From @KyleAMathews in #48:

Check out gatsby-starter-blog, it creates paths from the filename. There's a helper function for doing this

This would allow us to not require the path property in frontmatter, which is a bit of a hang up for Netlify CMS.

Nothing happens on click to confirm email

I am using this started for an open source web site https://github.com/bzhr/funky_fresh. Identity widget is loaded in the index page https://github.com/bzhr/funky_fresh/blob/master/src/pages/index.js

In the console I can see the widget is loaded by checking the window.netlifyIdentity object. But when I hit the confirm email link in my email I am redirected to the index page, the token is in the URL, but nothing happens.

If the email is from Gmail the user can sign in with gmail and the email will be confirmed, however some users won't use gmail emails, so this isn't a solution. Not sure if I am doing something wrong, or there's an issue with the identity widget.

Removing path prefixes

Hello, I love this starter repo and would like to move forward with it. However, blog posts are currently located at mysite.com/blog/my-blog-post. How can I remove the blog path prefix so blog posts are accessible via mysite.com/my-blog-post?

Thank you!

Official Template

Are you planning on submitting this to the Netlify CMS docs as a starter site/template?

Required leading slash in `path`

When in NetlfyCMS, filling in path with my-hello-world will make the build fail as described below.
Adding a slash as the other example content items, these pass.

Is it possible to make the following query more flexible for path values?

export const pageQuery = graphql`
  query BlogPostByPath($path: String!) {
    markdownRemark(frontmatter: { path: { eq: $path } }) {
      html
      frontmatter {
        path
        date(formatString: "MMMM DD, YYYY")
        title
        description
      }
    }
  }
`;
3:08:42 PM: Build ready to start
3:08:44 PM: Fetching cached dependencies
3:08:45 PM: Starting to download cache of 178.5MB
3:08:46 PM: Finished downloading cache in 1.174106868s
3:08:46 PM: Starting to extract cache
3:08:54 PM: Finished extracting cache in 8.074521067s
3:08:54 PM: Finished fetching cache in 9.401181086s
3:08:54 PM: Starting to prepare the repo for build
3:08:54 PM: Preparing Git Reference refs/heads/master
3:08:55 PM: Found netlify.toml. Overriding site configuration
3:08:55 PM: Running build command: npm run build
3:08:55 PM: Installing dependencies
3:08:58 PM: v6.12.3 is already installed.
3:09:00 PM: Now using node v6.12.3 (npm v3.10.10)
3:09:00 PM: Using version v6.12.3 of node
3:09:00 PM: Using /opt/buildhome/.rvm/gems/ruby-2.1.2
3:09:01 PM: Installing NPM modules using Yarn version 0.18.1
3:09:01 PM: yarn install v0.18.1
3:09:02 PM: [1/4] Resolving packages...
3:09:03 PM: success Already up-to-date.
3:09:03 PM: Done in 1.60s.
3:09:03 PM: NPM modules installed using Yarn
3:09:03 PM: Installing missing commands
3:09:03 PM: Executing user command: npm run build
3:09:04 PM: > [email protected] build /opt/build/repo
3:09:04 PM: > gatsby build
3:09:06 PM: success delete html files from previous builds — 0.015 s
3:09:06 PM: success open and validate gatsby-config.js — 0.007 s
3:09:07 PM: success copy gatsby files — 0.034 s
3:09:07 PM: success onPreBootstrap — 0.011 s
3:09:07 PM: success source and transform nodes — 0.187 s
3:09:07 PM: success building schema — 0.357 s
3:09:07 PM: success createLayouts — 0.015 s
3:09:08 PM: success createPages — 0.130 s
3:09:08 PM: success createPagesStatefully — 0.021 s
3:09:08 PM: success onPreExtractQueries — 0.002 s
3:09:08 PM: success extract queries from components — 0.285 s
3:09:08 PM: The GraphQL query from /opt/build/repo/src/templates/blog-post.js failed
3:09:08 PM:         Errors:
3:09:08 PM:           GraphQLError: Cannot read property 'id' of undefined
3:09:08 PM:         Query:
3:09:08 PM:           query BlogPostByPath(
3:09:08 PM:   $path: String!
3:09:08 PM: ) {
3:09:08 PM:   markdownRemark(frontmatter: {path: {eq: $path}}) {
3:09:08 PM:     html
3:09:08 PM:     frontmatter {
3:09:08 PM:       path
3:09:08 PM:       date(formatString: "MMMM DD, YYYY")
3:09:08 PM:       title
3:09:08 PM:       description
3:09:08 PM:     }
3:09:08 PM:   }
3:09:08 PM: }
3:09:08 PM: success run graphql queries — 0.080 s
3:09:08 PM: success write out page data — 0.004 s
3:09:08 PM: success write out redirect data — 0.001 s
3:09:08 PM: success update schema — 0.270 s
3:09:08 PM: The GraphQL query from /opt/build/repo/src/templates/blog-post.js failed
3:09:08 PM:         Errors:
3:09:08 PM:           GraphQLError: Cannot read property 'id' of undefined
3:09:08 PM:         Query:
3:09:08 PM:           query BlogPostByPath(
3:09:08 PM:   $path: String!
3:09:08 PM: ) {
3:09:08 PM:   markdownRemark(frontmatter: {path: {eq: $path}}) {
3:09:08 PM:     html
3:09:08 PM:     frontmatter {
3:09:08 PM:       path
3:09:08 PM:       date(formatString: "MMMM DD, YYYY")
3:09:08 PM:       title
3:09:08 PM:       description
3:09:09 PM:     }
3:09:09 PM:   }
3:09:09 PM: }
3:09:09 PM: success onPostBootstrap — 0.004 s
3:09:09 PM: info bootstrap finished - 4.227 s
3:09:09 PM: The GraphQL query from /opt/build/repo/src/templates/blog-post.js failed
3:09:09 PM:         Errors:
3:09:09 PM:           GraphQLError: Cannot read property 'id' of undefined
3:09:09 PM:         Query:
3:09:09 PM:           query BlogPostByPath(
3:09:09 PM:   $path: String!
3:09:09 PM: ) {
3:09:09 PM:   markdownRemark(frontmatter: {path: {eq: $path}}) {
3:09:09 PM:     html
3:09:09 PM:     frontmatter {
3:09:09 PM:       path
3:09:09 PM:       date(formatString: "MMMM DD, YYYY")
3:09:09 PM:       title
3:09:09 PM:       description
3:09:09 PM:     }
3:09:09 PM:   }
3:09:09 PM: }
3:09:09 PM: The GraphQL query from /opt/build/repo/src/templates/blog-post.js failed
3:09:09 PM:         Errors:
3:09:09 PM:           GraphQLError: Cannot read property 'id' of undefined
3:09:09 PM:         Query:
3:09:09 PM:           query BlogPostByPath(
3:09:09 PM:   $path: String!
3:09:09 PM: ) {
3:09:09 PM:   markdownRemark(frontmatter: {path: {eq: $path}}) {
3:09:09 PM:     html
3:09:09 PM:     frontmatter {
3:09:09 PM:       path
3:09:09 PM:       date(formatString: "MMMM DD, YYYY")
3:09:09 PM:       title
3:09:09 PM:       description
3:09:09 PM:     }
3:09:09 PM:   }
3:09:09 PM: }
3:09:09 PM: The GraphQL query from /opt/build/repo/src/templates/blog-post.js failed
3:09:09 PM:         Errors:
3:09:09 PM:           GraphQLError: Cannot read property 'id' of undefined
3:09:09 PM:         Query:
3:09:09 PM:           query BlogPostByPath(
3:09:09 PM:   $path: String!
3:09:09 PM: ) {
3:09:09 PM:   markdownRemark(frontmatter: {path: {eq: $path}}) {
3:09:09 PM:     html
3:09:09 PM:     frontmatter {
3:09:09 PM:       path
3:09:09 PM:       date(formatString: "MMMM DD, YYYY")
3:09:10 PM:       title
3:09:10 PM:       description
3:09:10 PM:     }
3:09:10 PM:   }
3:09:10 PM: }
3:09:10 PM: The GraphQL query from /opt/build/repo/src/templates/blog-post.js failed
3:09:10 PM:         Errors:
3:09:10 PM:           GraphQLError: Cannot read property 'id' of undefined
3:09:10 PM:         Query:
3:09:10 PM:           query BlogPostByPath(
3:09:10 PM:   $path: String!
3:09:10 PM: ) {
3:09:10 PM:   markdownRemark(frontmatter: {path: {eq: $path}}) {
3:09:10 PM:     html
3:09:10 PM:     frontmatter {
3:09:10 PM:       path
3:09:10 PM:       date(formatString: "MMMM DD, YYYY")
3:09:10 PM:       title
3:09:10 PM:       description
3:09:10 PM:     }
3:09:10 PM:   }
3:09:10 PM: }
3:09:19 PM: success Building CSS — 10.535 s
3:09:19 PM: The GraphQL query from /opt/build/repo/src/templates/blog-post.js failed
3:09:19 PM:         Errors:
3:09:19 PM:           GraphQLError: Cannot read property 'id' of undefined
3:09:19 PM:         Query:
3:09:19 PM:           query BlogPostByPath(
3:09:19 PM:   $path: String!
3:09:19 PM: ) {
3:09:19 PM:   markdownRemark(frontmatter: {path: {eq: $path}}) {
3:09:19 PM:     html
3:09:19 PM:     frontmatter {
3:09:19 PM:       path
3:09:19 PM:       date(formatString: "MMMM DD, YYYY")
3:09:19 PM:       title
3:09:19 PM:       description
3:09:19 PM:     }
3:09:19 PM:   }
3:09:19 PM: }
3:09:19 PM: The GraphQL query from /opt/build/repo/src/templates/blog-post.js failed
3:09:19 PM:         Errors:
3:09:19 PM:           GraphQLError: Cannot read property 'id' of undefined
3:09:19 PM:         Query:
3:09:19 PM:           query BlogPostByPath(
3:09:19 PM:   $path: String!
3:09:19 PM: ) {
3:09:19 PM:   markdownRemark(frontmatter: {path: {eq: $path}}) {
3:09:19 PM:     html
3:09:19 PM:     frontmatter {
3:09:19 PM:       path
3:09:19 PM:       date(formatString: "MMMM DD, YYYY")
3:09:19 PM:       title
3:09:19 PM:       description
3:09:19 PM:     }
3:09:19 PM:   }
3:09:19 PM: }
3:10:08 PM: success Building production JavaScript bundles — 48.725 s
3:10:08 PM: The GraphQL query from /opt/build/repo/src/templates/blog-post.js failed
3:10:08 PM:         Errors:
3:10:08 PM:           GraphQLError: Cannot read property 'id' of undefined
3:10:08 PM:         Query:
3:10:08 PM:           query BlogPostByPath(
3:10:08 PM:   $path: String!
3:10:08 PM: ) {
3:10:08 PM:   markdownRemark(frontmatter: {path: {eq: $path}}) {
3:10:08 PM:     html
3:10:08 PM:     frontmatter {
3:10:08 PM:       path
3:10:08 PM:       date(formatString: "MMMM DD, YYYY")
3:10:08 PM:       title
3:10:08 PM:       description
3:10:08 PM:     }
3:10:08 PM:   }
3:10:08 PM: }
3:10:08 PM: The GraphQL query from /opt/build/repo/src/templates/blog-post.js failed
3:10:08 PM:         Errors:
3:10:08 PM:           GraphQLError: Cannot read property 'id' of undefined
3:10:08 PM:         Query:
3:10:08 PM:           query BlogPostByPath(
3:10:08 PM:   $path: String!
3:10:08 PM: ) {
3:10:08 PM:   markdownRemark(frontmatter: {path: {eq: $path}}) {
3:10:08 PM:     html
3:10:08 PM:     frontmatter {
3:10:08 PM:       path
3:10:08 PM:       date(formatString: "MMMM DD, YYYY")
3:10:08 PM:       title
3:10:08 PM:       description
3:10:08 PM:     }
3:10:08 PM:   }
3:10:08 PM: }
3:10:12 PM: error Building static HTML for pages failed
3:10:12 PM: See our docs page on debugging HTML builds for help https://goo.gl/yL9lND
3:10:12 PM:   29 |
3:10:12 PM:   30 |   return (<BlogPostTemplate
3:10:12 PM: > 31 |     content={post.html}
3:10:12 PM:      |                   ^
3:10:12 PM:   32 |     contentComponent={HTMLContent}
3:10:12 PM:   33 |     description={post.frontmatter.description}
3:10:12 PM:   34 |     helmet={<Helmet title={`Blog | ${post.frontmatter.title}`} />}
3:10:12 PM: 
3:10:12 PM:   WebpackError: Cannot read property 'html' of null
3:10:12 PM:   
3:10:12 PM:   - blog-post.js:31 exports.default
3:10:12 PM:     src/templates/blog-post.js:31:19
3:10:12 PM:   
3:10:12 PM:   - ReactCompositeComponent.js:306 ReactCompositeComponentWrapper._constructComp    onentWithoutOwner
3:10:12 PM:     ~/react-dom/lib/ReactCompositeComponent.js:306:1
3:10:12 PM:   
3:10:12 PM:   - ReactCompositeComponent.js:282 ReactCompositeComponentWrapper._constructComp    onent
3:10:12 PM:     ~/react-dom/lib/ReactCompositeComponent.js:282:1
3:10:12 PM:   
3:10:12 PM:   - ReactCompositeComponent.js:185 ReactCompositeComponentWrapper.mountComponent    ~/react-dom/lib/ReactCompositeComponent.js:185:1
3:10:12 PM:   
3:10:12 PM:   - ReactReconciler.js:43 Object.mountComponent
3:10:12 PM:     ~/react-dom/lib/ReactReconciler.js:43:1
3:10:12 PM:   
3:10:12 PM:   - ReactMultiChild.js:234 ReactDOMComponent.mountChildren
3:10:12 PM:     ~/react-dom/lib/ReactMultiChild.js:234:1
3:10:12 PM:   
3:10:12 PM:   - ReactDOMComponent.js:657 ReactDOMComponent._createContentMarkup
3:10:12 PM:     ~/react-dom/lib/ReactDOMComponent.js:657:1
3:10:12 PM:   
3:10:12 PM:   - ReactDOMComponent.js:524 ReactDOMComponent.mountComponent
3:10:12 PM:     ~/react-dom/lib/ReactDOMComponent.js:524:1
3:10:12 PM:   
3:10:12 PM:   - ReactReconciler.js:43 Object.mountComponent
3:10:12 PM:     ~/react-dom/lib/ReactReconciler.js:43:1
3:10:12 PM:   
3:10:12 PM:   - ReactMultiChild.js:234 ReactDOMComponent.mountChildren
3:10:12 PM:     ~/react-dom/lib/ReactMultiChild.js:234:1
3:10:12 PM:   
3:10:12 PM: 
3:10:12 PM: npm ERR! Linux 4.4.86+
3:10:12 PM: npm ERR! argv "/opt/buildhome/.nvm/versions/node/v6.12.3/bin/node" "/opt/buildhome/.nvm/versions/node/v6.12.3/bin/npm" "run" "build"
3:10:12 PM: npm ERR! node v6.12.3
3:10:12 PM: npm ERR! npm  v3.10.10
3:10:12 PM: npm ERR! code ELIFECYCLE
3:10:12 PM: npm ERR! [email protected] build: `gatsby build`
3:10:12 PM: npm ERR! Exit status 1
3:10:12 PM: npm ERR!
3:10:12 PM: npm ERR! Failed at the [email protected] build script 'gatsby build'.
3:10:12 PM: npm ERR! Make sure you have the latest version of node.js and npm installed.
3:10:12 PM: npm ERR! If you do, this is most likely a problem with the gatsby-starter-netlify-cms package,
3:10:12 PM: npm ERR! not with npm itself.
3:10:12 PM: npm ERR! Tell the author that this fails on your system:
3:10:12 PM: npm ERR!     gatsby build
3:10:12 PM: npm ERR! You can get information on how to open an issue for this project with:
3:10:12 PM: npm ERR!     npm bugs gatsby-starter-netlify-cms
3:10:12 PM: npm ERR! Or if that isn't available, you can get their info via:
3:10:13 PM: npm ERR!     npm owner ls gatsby-starter-netlify-cms
3:10:13 PM: npm ERR! There is likely additional logging output above.
3:10:13 PM: npm ERR! Please include the following file with any support request:
3:10:13 PM: npm ERR!     /opt/build/repo/npm-debug.log
3:10:13 PM: Caching artifacts
3:10:13 PM: Cached NPM modules
3:10:13 PM: Saved Yarn cache
3:10:13 PM: Saved Cache Directory
3:10:13 PM: Build complete: exit code: 1
3:10:13 PM: Error running command: Build script returned non-zero exit code: 1
3:10:13 PM: Failing build: Failed to build site
3:10:13 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
3:10:13 PM: Finished processing build request in 1m29.642177303s

feature: responsive design

Halo, looks like it's not responsive already.
will be nice to have responsive feature with hamburger menu.

Thanks

Admin login not working?

I published the site (without any modification after creating) on Netlify (just by dropping the public folder), and enabled the Identity service (with gitlab provider). After logging in with Gitlab account I'm redirected to main site page (with OAuth access_token) but it didn't redirect me back to admin interface.
I had to add

<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>

in <head>
and

<script>
  if (window.netlifyIdentity) {
    window.netlifyIdentity.on("init", user => {
      if (!user) {
        window.netlifyIdentity.on("login", () => {
          document.location.href = "/admin/";
        });
      }
    });
  }
</script>

before <body> end in main site index.html just as the documentation says. Shouldn't you make gatsby add it automatically to public/index.html?

Nonetheless, admin interface now loads, but I fail to see any content that is already present on the site. But maybe it's because the site was not created from Git.

Featuring this template on the docs site

Just a heads up! We're looking to feature this (excellent!) template on the docs site with the 1.0 launch as we try to improve discoverability of great community resources like this.

We may try to get a PR in for custom preview styling (and maybe other integration tweaks), and another to bump the version to 1.0 at release time. If you have any availability to review pull requests as they come it would be super helpful!

cc/ @Benaiah

Getting entries from a Collection

I'm trying to get entries from a collection, just like in the sample app, the home page is pulling the blog posts.

I was able to generate the new collection and then create a new page under the /src/pages. Inside of that page, I have this query:

export const ProdQuery = graphql
  query ProdQuery {
    allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }) {
      edges {
        node {
          html
          frontmatter {
            price
            prod_image
            slug
            sku
            templateKey
            title
          }
        }
      }
    }
  }

this gets all the entries, and then in my component I have to do something like:
const products = posts.filter( post => post.node.frontmatter.templateKey === 'product-details')
to only get the product-details collection entries.

The question is, how can I tell the graphql to get me the product details only, so I don't have to be pulling all the entries, and then having to filter what I need, in my component?

Thanks in advance!

Can't access /admin locally after updating URL

After deployment to Netlify I've changed the URL of the site. Now when I try to test the /admin page locally I get a error:

Failed to load settings from https://some-link-e767e6.netlify.com/.netlify/identity

The URL its displaying here is the old one so I'm not surprised it can't load the settings but I can't seem to find where I can update this url. Any ideas?

use local cms.css

The netlify-cms CSS file is hardcoded in /static/admin/index.html:
<link rel="stylesheet" href="https://unpkg.com/netlify-cms@^1.0.1/dist/cms.css" />

This leads to problems when upgrading netlify-cms to a new version and when a restrictive Content Security Policy is used.

The right CSS file is already in /cms/node_modules/netlify-cms/dist/cms.css... is it possible to use this?

New project Error

I started a new project, and if I run npm install I get this message.
I can't run gatsby develop either.

Any help will be appreciate it.

npm WARN [email protected] No repository field.

npm ERR! Cannot read property '0' of undefined

Logs:

30254 warn [email protected] No repository field.
30255 verbose stack TypeError: Cannot read property '0' of undefined
30255 verbose stack     at rmStuff (/usr/local/lib/node_modules/npm/lib/unbuild.js:61:24)
30255 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
30255 verbose stack     at ret (eval at makeNodePromisifiedEval (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)
30255 verbose stack     at lifecycle.then.then (/usr/local/lib/node_modules/npm/lib/install/action/unbuild.js:12:12)
30255 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
30255 verbose stack     at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
30255 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
30255 verbose stack     at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
30255 verbose stack     at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
30255 verbose stack     at Promise._fulfill (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
30255 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/nodeback.js:42:21
30255 verbose stack     at <anonymous>

Content not showing in Admin?

I know @Furgas mentioned this in #3 but it is also happening to me & I wondered if y'all solved this.

In admin all is empty, and if I try to create a new blog post Netlify cms throws the error Failed to persist entry: TypeError: Cannot read property 'sha' of undefined. All seems to be configured correctly in config.yml & I couldn't find an answer in the Netlify docs. ¯_(ツ)_/¯

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.