Type something to search...

Adding Content

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:

FormatMarkdownResult
Bold**bold**bold
Italic*italic*italic
Link[text](url)text
Image![alt](/path.jpg)Image display
Heading## HeadingHeading

Headings:

# Heading 1
## Heading 2
### Heading 3

Lists:

- Unordered item
- Another item

1. Numbered item
2. Another item

Code:

Inline `code` here

\`\`\`javascript
// Code block
const x = 1;
\`\`\`

Quotes:

> This is a blockquote

Creating 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

  1. Create a .md file in the appropriate content/ folder
  2. Add the required frontmatter
  3. Write your content

Content Types

Astrolock supports different types of content:

TypeUse ForLocation
PagesAbout, Contact, etc.content/pages/
CollectionsBlog posts, audio, imagescontent/{collection}/
AuthorsAuthor profilescontent/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: