What a post can contain

· 1 min read

A document with a heading and lines of text on a dark teal and blue background

This is a second sample post. It exists to show how the common Markdown elements look on the site. Replace it with your own, or delete its folder.

It is not marked featured, so it appears on the blog page but not on the home page.

Text

A paragraph can hold bold text, italic text, inline code and links. Lines wrap at a width that stays comfortable to read on a wide screen.

A blockquote sets a passage apart from the text around it.

Lists

An unordered list:

  • Posts live in dated folders.
  • The slug sets the URL.
  • The cover image is optional.

An ordered list:

  1. Create a folder named with the date.
  2. Add index.md with the frontmatter.
  3. Run npm run dev to preview it.

Code

Fenced code blocks are highlighted at build time, so no script runs in the browser.

interface Post {
  slug: string;
  title: string;
  featured: boolean;
}

const featured = (posts: Post[]) => posts.filter((post) => post.featured);

Shell commands

Third-level headings are indented in the “On this page” list.

npm run dev
npm run build

Tables

Field Required What it does
slug Yes Sets the URL
featured No Lists the post on the home page
cover No Banner, thumbnail and share image

Images

An image in the body sits next to index.md, the same as the cover, and is written as ![Description](./photo.jpg). Astro resizes it and serves it in a modern format.


← All posts