Type something to search...

Text Collections

Create blog posts, articles, and written content

Text collections are for written content like blog posts, articles, and news updates.

Creating a Text Post

Using the CLI

astrolock content blog "My Blog Post Title"

This creates a file at content/blog/my-blog-post-title.md with starter frontmatter.

Manual Creation

Create a .md file in your collection folder:

---
title: "My Blog Post"
date: 2025-01-15T00:00:00Z
author: "Your Name"
description: "A brief summary for search engines and previews"
categories:
  - Technology
tags:
  - Tutorial
  - Beginner
---

Your content starts here. Write in Markdown.

## A Subheading

More content...

Frontmatter Fields

Required

FieldDescription
titleThe post title (displayed as heading)
FieldDescriptionExample
datePublication date2025-01-15
authorContent author"Your Name"
descriptionSEO summary (160 chars)"Learn how to..."
imageFeatured image path"/images/content/blog/hero.jpg"

Optional

FieldDescription
categoriesContent groupings (list)
tagsKeyword labels (list)
draftSet true to hide from site
tocTable of contents settings

Info

See Text Frontmatter Reference for all fields.

Adding Images

Set in frontmatter:

---
title: "My Post"
image: "/images/content/blog/my-post.jpg"
---

Warning

Put the actual image file at public/images/content/blog/my-post.jpg

Inline Images

Use Markdown image syntax in your content:

![Description of image](/images/content/blog/screenshot.png)

Categories and Tags

Organize your content with categories and tags:

---
title: "Getting Started with React"
categories:
  - Development
  - Frontend
tags:
  - React
  - JavaScript
  - Tutorial
---

Categories are broad groupings (usually 1-2 per post). Tags are specific keywords (as many as relevant).

Table of Contents

Open Table of Contents

Example: Complete Blog Post

---
title: "10 Tips for Better Writing"
date: 2025-01-15T00:00:00Z
author: "Jane Smith"
description: "Practical tips to improve your writing skills"
image: "/images/content/blog/writing-tips.jpg"
categories:
  - Writing
tags:
  - Tips
  - Productivity
toc:
  enable: true
---

Good writing takes practice. Here are my top tips...

## 1. Write Every Day

Consistency matters more than perfection.

## 2. Read Widely

The best writers are avid readers...

Next Steps