-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
CLI Utils for Gatsby devs/admins? #850
Comments
I think CLI tools to generate posts (markdown files I'm assuming you mean) make a ton of sense. I just wrote a little script for my Gatsby journal (closed source sorry 😛) which asks me what the title of the post is and then creates the file with yaml frontmatter, a sluggified pathname, etc. One problem with having a universal tool like what you're suggesting is that it's not... universal. There are lots of potential filename schemes plus also Gatsby can and is used for all sorts of things other than simple markdown blogs. One potential future that makes sense is if 1.0 plugins/themes could add commands to the CLI. Then a blog markdown theme with a set directory/file structure, etc. could add a command for creating new markdown files within the constraints they've setup. Thoughts? |
You can use plop, it's really quick/easy to use ;) Example => fabien0102/gatsby-starter@e122fb2 (I will add a blog post generator when my starter will have blog post 😄 ) So I got same opinion as @KyleAMathews, it's not really universal and prefer to have my generators into my source code (so you can have very personnalize generator in function of yours needs) |
Awesome input, guys! Kyle, your script sounds pretty much like the new post functionaly in One way to make this universal would be to allow the user to define their own frontmatter generator but at that point it feels like I'm just making a more narrowly focused plop from my quick glance at their repo. I may continue working on my utils project, depending on what I learn about plop. If my project ends up being a universal way to create posts (or anything else valuable) from the cli I'll update this issue. |
This was also mentioned in #263. Linking these together. |
I've been using Gatsby to build out my new blog and one of the first things I felt was missing was an easy way to create a new post. I created gatsby-utils to address this, but I realized this might be something worth rolling into the gatsby cli itself. I also found gatsby-dev-cli but couldn't find a repo or anything for it.
Any thoughts?
The text was updated successfully, but these errors were encountered: