Composite

PostLayout

The body of a blog post page: cover, title, meta line, Markdown and tags.

Basic

On an entry page, renderEntry returns these props as layout and the rendered Markdown as Content, which goes in the default slot. The body uses the prose class from @tailwindcss/typography, coloured from the theme tokens, so it follows light and dark mode.

A hand writing notes with a pen in a notebook on a wooden desk

Hello, world

Updated By Astro Blocks1 min read

Collections let you write content as Markdown files and list them with one block.

What you get

  • A typed schema per preset.
  • A list page and an entry page, each about ten lines.

Write the content; the blocks handle the rest.

Inline code and links use the theme tokens.

  • announcement
  • collections
basic
---
import PostLayout from '@alfadormx/blocks/composite/PostLayout.astro';
---

<PostLayout
  headline={{ title: 'Hello, world', htmlTag: 'h2' }}
  date={new Date('2026-10-01T12:00:00Z')}
  updated={new Date('2026-10-20T12:00:00Z')}
  author="Astro Blocks"
  readingTime={1}
  tags={['announcement', 'collections']}
  image={{
    src: '~/assets/images/content/writing-notebook.jpg',
    alt: 'A hand writing notes with a pen in a notebook on a wooden desk',
  }}
>
  <p>Collections let you write content as Markdown files and list them with one block.</p>
  <h2>What you get</h2>
  <ul>
    <li>
      A typed schema per <strong>preset</strong>.
    </li>
    <li>A list page and an entry page, each about ten lines.</li>
  </ul>
  <blockquote>
    <p>Write the content; the blocks handle the rest.</p>
  </blockquote>
  <p>
    Inline <code>code</code> and <a href="/documentation">links</a> use the theme tokens.
  </p>
</PostLayout>

Body width

bodyClass merges after prose, so typography modifiers apply: here max-w-none lets the text use the full width, and prose-lg would enlarge it.

A wide body

This paragraph runs the full width of the layout because bodyClass removed the default reading width.

body-class
---
import PostLayout from '@alfadormx/blocks/composite/PostLayout.astro';
---

<PostLayout
  headline={{ title: 'A wide body', htmlTag: 'h2' }}
  date={new Date('2026-10-01T12:00:00Z')}
  bodyClass="max-w-none"
>
  <p>
    This paragraph runs the full width of the layout because <code>bodyClass</code> removed the
    default reading width.
  </p>
</PostLayout>

API Reference

PropTypeDefaultDescription
headlineHeadlineProps—Entry title (default: htmlTag 'h1').
imageImageProps—Cover image above the title.
tagsstring[]—Tags under the body (default: []).
langCodestring—Language of the layout's dates and UI strings (default: the site's default language).
classstring—Classes on the layout root (`data-entry-layout`).
bodyClassstring—Classes on the Markdown body wrapper (`data-entry-body`), merged after `prose`; use typography modifiers such as `prose-lg` or `max-w-none`.
tagsClassstring—Classes on the tags list (`data-entry-layout-tags`).
dateDate—Publication date, formatted in the layout language's locale.
updatedDate—Last update; shown as "Updated …" when set.
authorstring—Author name.
readingTimenumber | false—Minutes to read; `false` or unset hides it.