Adding new posts in AstroPaper theme
Here are some rules/recommendations, tips & ticks for creating new posts in AstroPaper blog theme.
Table of contents
Frontmatter
Frontmatter is the main place to store some important information about the post (article). Frontmatter lies at the top of the article and is written in YAML format. Read more about frontmatter and its usage in astro documentation.
Here is the list of frontmatter property for each post.
Property | Description | Remark |
---|---|---|
title | Title of the post. (h1) | required* |
description | Description of the post. Used in post excerpt and site description of the post. | required* |
pubDatetime | Published datetime in ISO 8601 format. | required* |
author | Author of the post. | default = SITE.author |
postSlug | Slug for the post. Will automatically be slugified. | default = slugified title |
featured | Whether or not display this post in featured section of home page | default = false |
draft | Mark this post ‘unpublished’. | default = false |
tags | Related keywords for this post. Written in array yaml format. | default = others |
ogImage | OG image of the post. Useful for social media sharing and SEO. | default = SITE.ogImage or generated SVG image |
Only title
, description
and pubDatetime
fields in frontmatter must be specified.
Title and description (excerpt) are important for search engine optimization (SEO) and thus AstroPaper encourages to include these in blog posts.
slug
is the unique identifier of the url. Thus, slug
must be unique and different from other posts. The whitespace of slug
needs to be separated with -
or _
but -
is recommended. However, even if you don’t write the correct slug, AstroPaper will automatically slugify your incorrect slug. If slug is not specified, the slugified title of the post will be used as slug.