DEV Community

Cover image for How to integrate Netlify CMS with Gridsome?

How to integrate Netlify CMS with Gridsome?

Yashu Mittal on November 21, 2018

Gridsome is awesome 🤘🏻 and the possibility to integrate with other tools are endless... Let's get down the road and learn how to integrate Netlif...
Collapse
 
spicysanta profile image
spicysanta

Awesome guide, although when you try to deploy it to netlify using your git repository, netlify returns a

"failed during stage 'building site': Build script returned non-zero exit code: 1".
Any help?

Collapse
 
mittalyashu profile image
Yashu Mittal

Have tested it locally on your machine?

Collapse
 
trondulseth profile image
Trond Ulseth

Hi,

I have a fork of the starter kit, and was able to get it running at: upbeat-torvalds-ac1965.netlify.com

However going to upbeat-torvalds-ac1965.netlify.com... hoping to see the NetlifyCMS login I only get a "GitHub Auth Demo" page

Any advice on how to move on?

Collapse
 
trondulseth profile image
Trond Ulseth

I solved it. Had to replace the content of static/admin/index.html with this (from netlifycms.org/docs/add-to-your-si...

<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Content Manager</title>
</head>
<body>
  <!-- Include the script that builds the page and powers Netlify CMS -->
  <script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
</body>
</html>
Collapse
 
mittalyashu profile image
Yashu Mittal

That's great. Glad, it worked out. 😃

Collapse
 
mittalyashu profile image
Yashu Mittal

Could you share the screenshot of the problem you are facing?

Collapse
 
grayanchor profile image
Andrew Gray • Edited

Thank you for the article! I'm new to static site generators and the Jamstack, so these articles are very helpful as I do my research. My goal is to find an alternative to traditional CMS's using static site generators and headless CMS's.

Is it possible to run this in the cloud and automatically build and deploy when content changes in Netlify CMS? So far in my research I have only seen examples of running Gridsome locally and manually running the build process. If I could run it in the cloud and automatically build on content changes that would be closer to what I'm looking for. Thanks!

Collapse
 
mittalyashu profile image
Yashu Mittal

Really appreciate those kind words.

I am also very obsessed with static site generator that I literally started a podcast for it, it's called Static Site

There are many static site generator out there and as I am aware of NetlifyCMS does work with bunch of them.

Yeah, sure you can deploy your site anywhere you want, checkout the screenshot below.

How gridsome works

As you can see Gridsome just output static files like: HTML, CSS, JS and then you can host those static files anywhere you want.

With Netlify you get few additional feature where you don't have to deploy manually, if you want to host your site on cloud you have add pass it thought some CI for auto-deployment.

Hope, this clears your question. :)

Collapse
 
suitsat profile image
Sebastian Ulbel

Hi. Nice work. But how can I access the netlifyCMS backend? Normally its available via /admin - but this doesnt work for me. Can you provide more details?
Thanks.

Collapse
 
mittalyashu profile image
Yashu Mittal • Edited

Glad you liked it.

You can access the netlify cms backend by http://localhost:8080/admin, make sure that the admin directory is at the root and inside static directory.

Let me know if you found any other difficulty, while setting up NetlifyCMS integration with Gridsome.

Collapse
 
berkmann18 profile image
Maximilian Berkmann

It seems that your starter pack's config.yml doesn't include the required site_id field.

Thread Thread
 
mittalyashu profile image
Yashu Mittal

Which site_id you are referring about?

Collapse
 
hack_nug profile image
Nestor Vera

Did you change repo on config.yml to point to your own repo?

Collapse
 
suitsat profile image
Sebastian Ulbel

Yeah, didn't help though. But nevermind, moved on. Thanks!