astrolock content
Create new content items in your Astrolock site.
Synopsis
astrolock content <collection> <title> [--draft]
Description
The content command generates new content items with proper frontmatter templates. It works with:
- Blog posts (
blog) - Authors (
author) - Media items (any collection in
.astrolock/astrolock.yaml)
The command automatically:
- Generates a URL-friendly slug from the title
- Creates markdown with appropriate frontmatter
- Sets current date/time
- Uses your default author
Arguments
| Argument | Description |
|---|---|
<collection> | Target collection: blog, author, or any media collection |
<title> | Title of the content item (will be slugified for filename) |
Options
| Option | Description |
|---|---|
--draft, -d | Create as draft (won’t be published) |
Usage Examples
- Blog Post
- Author
- Media
- Draft
astrolock content blog "My First Post"Creates: content/blog/my-first-post.md
astrolock content author "John Doe"Creates: content/authors/john-doe.md
# Create a mix entry
astrolock content mixes "Summer Vibes 2025"
# Create a gallery item
astrolock content gallery "Mountain Landscapes"
# Create a video tutorial
astrolock content tutorials "Getting Started Guide"astrolock content blog "Work in Progress" --draftCreates with draft: true in frontmatter.
astrolock content blog "My First Post"Creates: content/blog/my-first-post.md
astrolock content author "John Doe"Creates: content/authors/john-doe.md
# Create a mix entry
astrolock content mixes "Summer Vibes 2025"
# Create a gallery item
astrolock content gallery "Mountain Landscapes"
# Create a video tutorial
astrolock content tutorials "Getting Started Guide"astrolock content blog "Work in Progress" --draftCreates with draft: true in frontmatter.
Generated Templates
---
title: "My First Post"
description: ""
date: 2025-01-15T10:30:00Z
author: "Your Name"
image: "/images/site/image-placeholder.png"
categories: []
tags: []
draft: false
---
Your content here...For media collections (audio, video, images):
---
title: "Summer Vibes 2025"
description: ""
date: 2025-01-15T10:30:00Z
author: "Your Name"
image: "/images/content/mixes/summer-vibes-2025.jpg"
audio: "/audio/content/mixes/summer-vibes-2025.mp3"
categories: []
tags: []
draft: false
---
Your content here...Next Steps
After creating content:
- Edit the file to add your content
- Add media files to the appropriate
public/subdirectory - Preview with
astrolock write - Build with
astrolock build
Tip
Media filenames must match the markdown slug. For summer-vibes-2025.md, your audio file should be summer-vibes-2025.mp3.
See Also
- astrolock write - Preview your site
- astrolock import - Bulk import content
- Your First Steps - Complete walkthrough