Create your first content in Astrolock
Content in Astrolock is written in Markdown - a simple text format that’s easy to learn.
Markdown Basics
Markdown files have two parts:
---
title: "My First Post"
date: 2025-01-15T00:00:00Z
author: "Your Name"
---
# This is a Heading
This is a paragraph with **bold** and *italic* text.
- Bullet point one
- Bullet point two
[A link](https://example.com)
Frontmatter
The section between --- marks is called frontmatter. It contains metadata about your content:
---
title: "Required - shown as the page title"
date: 2025-01-15 # Publication date
author: "Your Name" # Content author
description: "Brief summary for search engines"
image: "/images/hero.jpg" # Featured image
draft: true # Hide from published site
---
Info
See Frontmatter Reference for all available fields.
Content Body
After the frontmatter, write your content using Markdown:
| Format | Markdown | Result |
|---|---|---|
| Bold | **bold** | bold |
| Italic | *italic* | italic |
| Link | [text](url) | text |
| Image |  | Image display |
| Heading | ## Heading | Heading |
Headings:
# Heading 1
## Heading 2
### Heading 3Lists:
- Unordered item
- Another item
1. Numbered item
2. Another itemCode:
Inline `code` here
\`\`\`javascript
// Code block
const x = 1;
\`\`\`Quotes:
> This is a blockquoteCreating Content
Using the CLI
The easiest way to create content:
# Create a blog post
astrolock content blog "My First Post"
# Create an author profile
astrolock content author "Your Name"
This creates a file with the correct frontmatter template.
Manually Creating Files
- Create a
.mdfile in the appropriatecontent/folder - Add the required frontmatter
- Write your content
Content Types
Astrolock supports different types of content:
| Type | Use For | Location |
|---|---|---|
| Pages | About, Contact, etc. | content/pages/ |
| Collections | Blog posts, audio, images | content/{collection}/ |
| Authors | Author profiles | content/authors/ |
Tip
Learn more about each type in Content Collections.
Markdown vs MDX
For most content, use .md (Markdown) files.
Use .mdx when you need interactive components:
---
title: "Post with Components"
---
Regular Markdown here.
<Notice type="tip">
This is an interactive component!
</Notice>
<Accordion client:load title="Click to expand">
Hidden content here.
</Accordion>
Info
See MDX Reference for available components.
Next Steps
You’re ready to start creating! Choose your path:
- Content Collections - Deep dive into content types
- Publishing - Get your site online