Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Guide]: Adding Netlify CMS to Gatsby #2117

Merged
merged 7 commits into from
Mar 16, 2019
Merged

[Guide]: Adding Netlify CMS to Gatsby #2117

merged 7 commits into from
Mar 16, 2019

Conversation

krismorf
Copy link
Contributor

@krismorf krismorf commented Feb 21, 2019

Summary
Adding Netlify CMS to Gatsby Guide decaporg/decap-website#6

@netlify
Copy link

netlify bot commented Feb 21, 2019

Preview proposed changes to the CMS demo site in the link below:

Built with commit 669a55f

https://deploy-preview-2117--cms-demo.netlify.com

@erquhart
Copy link
Contributor

@krismorf here's an issue from someone that walked through the guide: #2120

@krismorf
Copy link
Contributor Author

@erquhart it was solved in a7ea13d

@krismorf krismorf marked this pull request as ready for review February 28, 2019 15:42
@erquhart
Copy link
Contributor

Awesome!

@erquhart
Copy link
Contributor

@verythorough have time to give this a review?

@netlify
Copy link

netlify bot commented Mar 1, 2019

Preview proposed changes to netlifycms.org in the link below:

Built with commit 669a55f

https://deploy-preview-2117--netlify-cms-www.netlify.com

Copy link
Contributor

@verythorough verythorough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The writing for this is fantastic! Thank you, @krismorf!

I made a few minor comments on the content, plus one logistical change required in the line 1 comment.

Awesome work!

website/content/docs/using-netlify-cms-with-gatsby.md Outdated Show resolved Hide resolved
website/content/docs/using-netlify-cms-with-gatsby.md Outdated Show resolved Hide resolved
website/content/docs/using-netlify-cms-with-gatsby.md Outdated Show resolved Hide resolved
website/content/docs/using-netlify-cms-with-gatsby.md Outdated Show resolved Hide resolved
website/content/docs/using-netlify-cms-with-gatsby.md Outdated Show resolved Hide resolved
website/content/docs/using-netlify-cms-with-gatsby.md Outdated Show resolved Hide resolved
Copy link
Contributor

@verythorough verythorough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! I caught one more tiny one I missed the first time.

Also waiting to hear if @tomrutgers or @erquhart have an opinion on menu placement.

Thanks for your patience!

@tomrutgers
Copy link
Contributor

tomrutgers commented Mar 6, 2019

@verythorough @erquhart Right, menu placement! We currently have all the customization in the 'Guides' section (and a 'Contributor Guide' in the Contributing section to make it a bit more confusing), leaving little room for the actual guides.. Would it make sense to reorganize the navigation and have a structure like described below? I'm aware that this is out of the scope of this PR, but it might be worth including it in the original issue. decaporg/decap-website#6

Guides

  • Gatsby
  • Hugo
  • Middleman
  • ...

Customization

  • Custom Widgets
  • Custom Previews
  • Custom Editor components

Contributing

  • How to contribute
  • Architecture

@verythorough
Copy link
Contributor

@tomrutgers that menu org sounds perfect. Also agree that it's out of scope here!

For this PR, @krismorf, if you can add the front matter I described, I think we can merge this one.

Then, maybe you'd like to make the PR for the menu re-grouping? I'm happy to go over what that would entail, if you're interested.

@krismorf
Copy link
Contributor Author

krismorf commented Mar 7, 2019

@verythorough the guide has been adjusted 🚀 I will open a new PR for the menu org.

@verythorough
Copy link
Contributor

Woot! Now with the front matter, we can see it in preview:
https://deploy-preview-2117--netlify-cms-www.netlify.com/docs/using-netlify-cms-with-gatsby/

LGTM 🎉

@verythorough
Copy link
Contributor

Added an issue for the menu re-ordering: #2149

@tomrutgers
Copy link
Contributor

tomrutgers commented Mar 8, 2019

I don't know Gatsby all that much, but this looks really easy to follow! I'll try it out tomorrow.

@verythorough It's been a while since I've seen a deploy preview posted by your account 😂

@tomrutgers tomrutgers requested a review from talves March 8, 2019 00:37
Benaiah
Benaiah previously requested changes Mar 8, 2019
Copy link
Contributor

@Benaiah Benaiah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ran through the instructions in the guide - thanks so much for the contribution! It looks like the Gatsby template this uses has blog posts as subfolders, so the default Gatsby blog posts do not show up in the admin when following this template, and the newly created blog posts are not created as folder-style posts like the sample posts. (Posts created by the CMS are still picked up and displayed by Gatsby, however, so the CMS set up by this guide is still functional). This should either be fixed, or the guide should not imply that the sample blog posts will be visible in the CMS.

(There is also a 404-derived error visible in the console due to the image folder not existing in GitHub yet, but this doesn't actually affect the functionality of the CMS since the folder is created as soon as you add an image. This superfluous error should be addressed by another PR, but it doesn't block this one in any way.)

@tomrutgers
Copy link
Contributor

Tried it out today, very easy to follow! Nice.
I agree with @Benaiah. I think we should point out that we do not follow the content/blog-post/index.md structure early on.

@krismorf
Copy link
Contributor Author

@tomrutgers @Benaiah thanks for the feedback. I will mention that Netlify CMS does not follow the default folder structure.

The guide works because in gatsby-config.js he have this:

{
  resolve: `gatsby-source-filesystem`,
  options: {
    path: `${__dirname}/content/blog`,
    name: `blog`,
  },
}

and in config.yml we point to that directory:

collections:
    folder: "content/blog"

Should we mention this as well? @verythorough can you please help with the wording?

Copy link
Collaborator

@talves talves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just a quick section on how to start the development locally?

yarn start

Propose advanced section for later date

We should include a section in the future to show an example of adding the cms through modulePath and be able to add custom previews for the collections.

@erquhart
Copy link
Contributor

erquhart commented Mar 14, 2019

@krismorf wording:

**Note:** each existing blog post in `gatsby-starter-blog` is stored in its own directory. Netlify CMS doesn't work with files that are stored this way ([feature request here] (https://github.com/netlify/netlify-cms/issues/1472)), so you won't be able to see or edit the starter's included sample blog posts in Netlify CMS, but you will be able to create and edit new posts.

Any further additions can happen after this is merged. Thanks so much for digging into this Kris!

Sent with GitHawk

Copy link
Contributor

@tomrutgers tomrutgers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@tomrutgers tomrutgers requested a review from Benaiah March 14, 2019 14:26
@tomrutgers
Copy link
Contributor

@Benaiah Can we get this merged?

@Benaiah Benaiah dismissed their stale review March 16, 2019 22:28

Requested should still be made after merge, but the issue isn't worth blocking the PR

@tomrutgers tomrutgers merged commit 1d935c7 into decaporg:master Mar 16, 2019
@talves
Copy link
Collaborator

talves commented Mar 16, 2019

@krismorf thanks for working on this and your patience. We hope things can move quicker on something so easy to review!

@krismorf krismorf deleted the krismorf-patch-1 branch March 16, 2019 22:52
@erquhart
Copy link
Contributor

I think @tomrutgers just realized he's a maintainer lol

Sent with GitHawk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants