To create a new blog post, you can use the interactive CLI:
pnpm create-post
This will prompt you for:
- Post slug (e.g., my-first-post)
- Title
- Description
- Tags (comma-separated)
You can also provide these arguments directly:
pnpm create-post my-first-post "My First Post" "A description" tag1 tag2
Instead of permanent deletion, posts are moved to a trash folder:
pnpm delete-post
This will:
- Show a list of existing posts
- Let you select which post to move to trash
- Ask for confirmation
You can also specify the post slug directly:
pnpm delete-post my-first-post
To restore a post from the trash:
pnpm restore-post
This will:
- Show a list of posts in the trash with deletion dates
- Let you select which post to restore
- Move the post back to the blog folder
To permanently delete all posts in the trash:
pnpm empty-trash
This will:
- Show all posts currently in the trash
- Ask for confirmation
- Require typing "DELETE" to confirm
- Permanently delete all trashed posts
The blog supports a draft system for working on posts before publishing them.
To create a new draft:
pnpm draft-post
This will prompt you for:
- Draft title
- Description
- Tags
You can also provide the title directly:
pnpm draft-post "My Draft Post"
Drafts are stored in content/_drafts/
with a .draft.md
extension.
List all drafts:
pnpm list-drafts
This shows:
- Draft title
- Description
- Last edited date
- Slug
Update a draft:
pnpm update-draft
This will:
- Show a list of available drafts
- Let you select which draft to update
- Prompt for new title, description, and tags
- Keep existing values if left empty
You can also specify the draft slug directly:
pnpm update-draft my-draft-post
Delete a draft:
pnpm delete-draft
This will:
- Show a list of available drafts
- Let you select which draft to delete
- Ask for confirmation
- Permanently delete the draft
You can also specify the draft slug directly:
pnpm delete-draft my-draft-post
When your draft is ready:
pnpm publish-draft
This will:
- Show a list of available drafts
- Let you select which draft to publish
- Move it to the blog folder
You can also specify the draft slug directly:
pnpm publish-draft my-draft-post
To convert a published post back to a draft:
pnpm unpublish-post
This will:
- Show a list of published posts
- Let you select which post to convert
- Move it to the drafts folder
You can also specify the post slug directly:
pnpm unpublish-post my-published-post
To update a published post:
pnpm update-post
This will:
- Show a list of published posts
- Let you select which post to update
- Prompt for new title, description, and tags
- Open your editor to update content
- Keep existing values if left empty
You can also specify the post slug directly:
pnpm update-post my-published-post