Run the interactive helper from the repository root:
./new-post.shThe script prompts for:
- Title
- Description / blog preview text
- Publish date, defaulting to today
- Author, defaulting to
andrew - Categories, as a comma-separated list
- Tags, as a comma-separated list
- URL/file slug, defaulting to a slugified title
- H1 heading, defaulting to the title
- Optional image path relative to the generated post
It creates a new Markdown file in docs/blog/posts named with the
YYYY-MM-DD-slug.md pattern. The generated post includes MkDocs blog
frontmatter, the preview text, a <!-- more --> marker, and a ## TODO
section to start drafting from.
The script exits without writing over an existing post.
Use POSTS_DIR to write posts somewhere else, which is useful for testing:
POSTS_DIR=/tmp/blog-posts ./new-post.shUse DEFAULT_AUTHOR to change the default author prompt:
DEFAULT_AUTHOR=your-name ./new-post.sh