Collection names
Originally, there are three collections:
blog
projects
talks
They work pretty much the same. If the collection is empty, the UI doesnโt show it.
For adding new collections, see the source code and follow the same pattern.
Adding content to the collection
The collectionโs content is located in src/content/COLLECTION
.
Inside, add a folder with your content in index.mdx
(or index.md
) file.
๐ /src/content/blog
โโโ ๐ post-1
โโโ ๐ index.md
โโโ ๐ post-2
โโโ ๐ index.mdx
In the above example, two blog posts will be generated with the folder name representing the slug.
https://example.com/blog/post-1
https://example.com/blog/post-2
Provide metadata
Metadata is required for each entry.
---
title: "How to add a blog post";
description: "Steo-by-step guide on adding a blog post";
date: "2024-03-21";
lastUpdateDate: "2025-01-13";
ogImage: "/images/article-og-image.png"
draft: false;
tags:
- guide
- important
---
title
- will be used as header, placed in metadata and RSS.description
- (optional) will be used as a subtitle, placed in metadata and in RSS. If missing, the global page description will be used in the metadata.date
- publish date in format:YYYY-MM-DD
lastUpdateDate
- (optional) date of the last update in format:YYYY-MM-DD
ogImage
- (optional) path (relative to the public folder) to the open graph image for this entrydraft
- (optional) iftrue
, the entry wonโt be included into final buildtags
- (optional) list of tags.
Itโs not required, but itโs recommended to keep the title as the URL-friendly version of the post title. According to this guide, the index.mdx
with the above content should be placed in src/content/blog/how-to-add-a-blog-post
.
Write content
All thatโs left to do is write the content under the metadata.
---
title: "How to add a blog post";
description: "Steo-by-step guide on adding a blog post";
date: "2024-03-21";
lastUpdateDate: "2025-01-13";
ogImage: "/images/article-og-image.png"
draft: false;
tags:
- guide
- important
---
## Before adding a blog post...
<!-- content -->
Content is expected to be in the Markdown format (MDX allowed in index.mdx
).
Read more:
Order
The order of the entries is determined by the date
field. The newest entries will be displayed first.
However, if lastUpdateDate
is present, the entry will be sorted by this field instead.
Astro Milidev is a minimalistic portfolio+blog Astro theme.
It originates from Trevor Lee 's Astro Micro theme, which is based on Mark Horn 's Astro Nano (after "nano" and "micro" comes "mili", hence the first part of the name).
Astro Milidev enhances the above codebases with a variety of features. I customized the original theme for my personal website, and also refactored core parts of the code, making it more customizable and extensible.
The changelog is available in this post: Everything new in Astro Milidev . Another post Getting started explains the configuration process step by step. The code is MIT-licensed and available on GitHub .
Enjoy!
Contact me: