11ty / eleventy-base-blog

A starter repository for a blog web site using the Eleventy static site generator.
https://demo-base-blog.11ty.dev/
MIT License
1.23k stars 619 forks source link

Generating a new blog post? #164

Open elliot-nelson opened 9 months ago

elliot-nelson commented 9 months ago

Thanks for all your work on this project btw!

I'd like to be able to sit in my blog project and type npm run new-post, and have it spit out content/blog/new-post/new-post.md, with the frontmatter date and title already set up, and pop open my editor so I can start typing.

I'm sure I can write up my own hack script to do this, just curious if there was a "recommended" way to do this in an Eleventy project.

rdela commented 3 weeks ago

This conversation on Mastodon may be of interest: https://mastodon.social/@rdela/112883508899548187

Mentions https://github.com/11ty/create and the bash script I use on my site (still on Gatsby but switching to Eleventy soon): https://github.com/rdela/rdela.com/blob/trunk/new.sh

@11ty/create should work in a npm script, or maybe a shell script works better?