Configure collections in .astrolock/astrolock.yaml
Configure collections in .astrolock/astrolock.yaml under the collections section.
Structure
collections:
defaults:
author: unknown
contentType: text
theme: astrobuild
blog:
displayName: Blog
contentType: text
features:
archive: true
Section Options
| Option | Type | Description |
|---|---|---|
defaults | object | Default values for all collections |
| Individual collection names | object | Collection definitions (e.g., blog, gallery, mixes) |
Default Options
| Option | Type | Description |
|---|---|---|
author | string | Default author |
contentType | string | Default content type |
theme | string | Default theme |
Collection Options
| Option | Type | Required | Description |
|---|---|---|---|
displayName | string | Yes | Human-readable name |
contentType | string | Yes | ”text”, “audio”, “images”, “video” |
features | object | No | Feature toggles |
defaults | object | No | Collection-specific defaults |
Features
| Feature | Values | Default | Description |
|---|---|---|---|
archive | true / false | false | Date-based browsing (year/month) |
indexStyle | posts / content / portfolio | posts | How to present the index page for the collection |
Archive Feature
When archive: true, Astrolock generates date-based archive pages:
- Year pages:
/blog/archive/2025/- All posts from 2025 - Month pages:
/blog/archive/2025/01/- All posts from January 2025 - Archive index:
/blog/archive/- Timeline view with all dates
collections:
blog:
features:
archive: true
Tip
Archive pages are ideal for blogs and time-sensitive content where readers might want to browse by date.
Index Style Feature
Controls how the collection’s index page (/collection/) displays content:
| Style | Layout | Use Case |
|---|---|---|
posts | Card grid with pagination and sidebar | Blog-style collections |
content | Renders -index.md body with optional TOC | Curated landing pages |
portfolio | Full-width masonry gallery | Photography portfolios |
Posts Style (Default)
Standard blog-style layout with cards, pagination, and sidebar widgets.
collections:
blog:
features:
indexStyle: posts
Content Style
Renders the body content from content/{collection}/-index.md instead of auto-generated posts list. Useful for curated landing pages with custom content.
collections:
flyers:
features:
indexStyle: content
Create your index content at content/{collection}/-index.md:
---
title: "My Collection"
---
Custom welcome text and curated content here...
Portfolio Style
Full-width masonry grid showing all images without pagination. Ideal for photography portfolios and visual showcases.
collections:
gallery:
features:
indexStyle: portfolio
Info
Portfolio style is only available for contentType: "images" collections.
Complete Example
collections:
defaults:
author: Site Author
contentType: text
theme: astrobuild
blog:
displayName: Blog
contentType: text
features:
archive: true
flyers:
displayName: Flyers
contentType: images
features:
archive: false
indexStyle: content
mixes:
displayName: DJ Mixes
contentType: audio
defaults:
contentExtension: .mp3
gallery:
displayName: Photo Gallery
contentType: images
features:
archive: false
indexStyle: portfolio
Next Steps
- Learn about Text Collections for blogs and articles
- Explore Audio Collections for music content
- Set up Image Collections for galleries
- See Menu Configuration for navigation setup