Skip to content

BlogLayout

BlogLayout is designed for blog posts with article-specific features like hero images, breadcrumbs, and related posts.

---
import BlogLayout from '@/layouts/BlogLayout.astro';
import { getCollection, render } from 'astro:content';
export async function getStaticPaths() {
const posts = await getCollection('blog');
return posts.map((post) => ({
params: { slug: post.id },
props: { post },
}));
}
const { post } = Astro.props;
const { Content } = await render(post);
---
<BlogLayout
title={post.data.title}
description={post.data.description}
publishedAt={post.data.publishedAt}
author={post.data.author}
tags={post.data.tags}
image={post.data.image}
>
<Content />
</BlogLayout>
PropTypeDefaultDescription
titlestringArticle title (required)
descriptionstringArticle description
publishedAtDatePublication date
updatedAtDateLast updated date
authorstring"Team"Author name
imagestringCover image URL
imageAltstringCover image alt text
tagsstring[][]Article tags
slugstringArticle slug for OG image

Displays article title, metadata, and optional cover image:

<ArticleHero
title={title}
publishedAt={publishedAt}
author={author}
image={image}
imageAlt={imageAlt}
/>

Automatic breadcrumb navigation:

Home > Blog > Article Title

Also generates BreadcrumbList JSON-LD schema.

Content is wrapped in prose classes for optimal reading:

<article class="prose prose-lg max-w-none">
<!-- MDX content -->
</article>

Social sharing buttons for the article:

  • Twitter
  • Facebook
  • LinkedIn
  • Copy link

Automatically shows related posts based on shared tags:

<RelatedPosts currentSlug={slug} tags={tags} />

BlogLayout automatically generates Article JSON-LD:

{
"@type": "Article",
"headline": "Article Title",
"datePublished": "2026-01-28",
"author": {
"@type": "Person",
"name": "Author Name"
},
"publisher": {
"@type": "Organization",
"name": "Site Name"
}
}

The default prose styling includes:

  • Responsive typography
  • Proper heading hierarchy
  • Code block styling
  • Table formatting
  • Image handling
  • Blockquote styling
// Syntax highlighted code
const greeting = 'Hello, World!';
Column 1Column 2
DataData

Images are responsive with lazy loading:

![Alt text](./image.jpg)