core
Blog
Display a list of blog posts from a content folder with sorting, filtering, and layout options
Source
import Markdoc from '@markdoc/markdoc';
import type { Node, RenderableTreeNode } from '@markdoc/markdoc';
import { createContentModelSchema, createComponentRenderable } from '../lib/index.js';
import { RenderableNodeCursor } from '../lib/renderable.js';
import { pageSectionProperties } from './common.js';
const { Tag } = Markdoc;
const sortOptions = ['date-desc', 'date-asc', 'title-asc', 'title-desc'] as const;
const layoutOptions = ['list', 'grid', 'compact'] as const;
export const blogSections = {
preamble: 'preamble',
headline: 'title',
blurb: 'description',
content: 'body',
} as const;
export const blog = createContentModelSchema({
sections: blogSections,
provides: ['prose'],
attributes: {
folder: {
type: String,
required: true,
description: 'Content folder path to list blog posts from (e.g. "/blog")',
},
sort: {
type: String,
required: false,
default: 'date-desc',
matches: sortOptions.slice(),
description: 'Sort order: date-desc, date-asc, title-asc, title-desc',
},
filter: {
type: String,
required: false,
default: '',
description:
'Filter expression to match against frontmatter fields (e.g. "tag:javascript" or "draft:false")',
},
limit: { type: Number, required: false, description: 'Maximum number of posts to display' },
layout: {
type: String,
required: false,
default: 'list',
matches: layoutOptions.slice(),
description: 'Display layout: list, grid, or compact',
},
},
contentModel: {
type: 'sequence',
fields: [
{ name: 'headline', match: 'heading', optional: true },
{ name: 'blurb', match: 'paragraph', optional: true },
],
},
transform(resolved, attrs, config) {
const headerAstNodes = [resolved.headline, resolved.blurb].filter(Boolean) as Node[];
const header = new RenderableNodeCursor(
Markdoc.transform(headerAstNodes, config) as RenderableTreeNode[],
);
const folderMeta = new Tag('meta', { content: attrs.folder });
const sortMeta = new Tag('meta', { content: attrs.sort || 'date-desc' });
const filterMeta = new Tag('meta', { content: attrs.filter || '' });
const limitMeta = new Tag('meta', { content: attrs.limit != null ? String(attrs.limit) : '' });
const layoutMeta = new Tag('meta', { content: attrs.layout || 'list' });
const postList = new Tag('div', {}, []);
const sectionProps = pageSectionProperties(header);
const headerContent = header.count() > 0 ? [header.wrap('header').next()] : [];
const children: any[] = [...headerContent, postList];
return createComponentRenderable({
rune: 'blog',
tag: 'section',
properties: {
folder: folderMeta,
sort: sortMeta,
filter: filterMeta,
limit: limitMeta,
layout: layoutMeta,
},
refs: {
...sectionProps,
posts: postList,
},
children,
});
},
});
Renders a list of blog posts from a specified content folder. Posts are automatically sorted by date and can be filtered, limited, and displayed in different layouts.
Basic usage
Point the folder attribute at a content directory containing your blog posts.
{% blog folder="/blog" %}
{% /blog %}<section data-rune="blog" data-rune-fields="{"folder":"/blog","sort":"date-desc","filter":"","limit":"","layout":"list"}">
<div data-name="posts"></div>
</section>What's New in 0.9.0
Metadata dimensions, universal theming, rune output standards, the plan package, Markdoc partials, and a Lumina design refresh.
What's New in 0.8.0
Declarative content models, a cross-page pipeline, media runes with streaming, and identity transform improvements.
What's New in 0.7.0
Eight official rune packages and new tooling for package authors.
What's New in 0.6.0
A full WYSIWYG editor, framework-neutral web components, layout transform engine, AI-powered theme designer, and a Python extraction pipeline.
What's New in 0.5.0
Theme development toolkit, behaviors library, six new runes, VS Code language server, and a major architecture shift toward framework-agnostic rendering.
What's New in 0.4.0
New packages, seven new runes, theme restructuring, syntax highlighting, and more.
<section class="rf-blog rf-blog--list" data-layout="list" data-sort="date-desc" data-filter="" data-limit="" data-folder="/blog" data-rune="blog" data-density="full">
<div data-name="content" class="rf-blog__content" data-section="body">
<div data-name="posts" class="rf-blog__posts">
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-9">What's New in 0.9.0</a>
</h3>
<time datetime="2026-03-30">2026-03-30</time>
<p>Metadata dimensions, universal theming, rune output standards, the plan package, Markdoc partials, and a Lumina design refresh.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-8">What's New in 0.8.0</a>
</h3>
<time datetime="2026-03-10">2026-03-10</time>
<p>Declarative content models, a cross-page pipeline, media runes with streaming, and identity transform improvements.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-7">What's New in 0.7.0</a>
</h3>
<time datetime="2026-03-03">2026-03-03</time>
<p>Eight official rune packages and new tooling for package authors.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-6">What's New in 0.6.0</a>
</h3>
<time datetime="2026-03-02">2026-03-02</time>
<p>A full WYSIWYG editor, framework-neutral web components, layout transform engine, AI-powered theme designer, and a Python extraction pipeline.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-5">What's New in 0.5.0</a>
</h3>
<time datetime="2026-02-23">2026-02-23</time>
<p>Theme development toolkit, behaviors library, six new runes, VS Code language server, and a major architecture shift toward framework-agnostic rendering.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-4">What's New in 0.4.0</a>
</h3>
<time datetime="2026-02-16">2026-02-16</time>
<p>New packages, seven new runes, theme restructuring, syntax highlighting, and more.</p>
</article>
</div>
</div>
</section>How Markdown is read
The posts come from folder; the body only adds a header above them.
| You write | It becomes |
|---|---|
| A heading | The headline above the post list (Page sections) |
| A paragraph after it | The blurb |
{% blog folder="/blog" layout="grid" %}
# Latest Posts
Stay up to date with the newest updates and tutorials.
{% /blog %}<section data-rune="blog" data-rune-fields="{"folder":"/blog","sort":"date-desc","filter":"","limit":"","layout":"grid"}">
<header>
<h1 id="latest-posts" data-name="headline">Latest Posts</h1>
<p data-name="blurb">Stay up to date with the newest updates and tutorials.</p>
</header>
<div data-name="posts"></div>
</section>Latest Posts
Stay up to date with the newest updates and tutorials.
What's New in 0.9.0
Metadata dimensions, universal theming, rune output standards, the plan package, Markdoc partials, and a Lumina design refresh.
What's New in 0.8.0
Declarative content models, a cross-page pipeline, media runes with streaming, and identity transform improvements.
What's New in 0.7.0
Eight official rune packages and new tooling for package authors.
What's New in 0.6.0
A full WYSIWYG editor, framework-neutral web components, layout transform engine, AI-powered theme designer, and a Python extraction pipeline.
What's New in 0.5.0
Theme development toolkit, behaviors library, six new runes, VS Code language server, and a major architecture shift toward framework-agnostic rendering.
What's New in 0.4.0
New packages, seven new runes, theme restructuring, syntax highlighting, and more.
<section class="rf-blog rf-blog--grid" data-layout="grid" data-sort="date-desc" data-filter="" data-limit="" data-folder="/blog" data-rune="blog" data-density="full">
<div data-name="content" class="rf-blog__content" data-section="body">
<header data-name="preamble" class="rf-blog__preamble" data-section="preamble">
<h1 id="latest-posts" data-name="headline" class="rf-blog__headline" data-section="title">Latest Posts</h1>
<p data-name="blurb" class="rf-blog__blurb" data-section="description">Stay up to date with the newest updates and tutorials.</p>
</header>
<div data-name="posts" class="rf-blog__posts">
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-9">What's New in 0.9.0</a>
</h3>
<time datetime="2026-03-30">2026-03-30</time>
<p>Metadata dimensions, universal theming, rune output standards, the plan package, Markdoc partials, and a Lumina design refresh.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-8">What's New in 0.8.0</a>
</h3>
<time datetime="2026-03-10">2026-03-10</time>
<p>Declarative content models, a cross-page pipeline, media runes with streaming, and identity transform improvements.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-7">What's New in 0.7.0</a>
</h3>
<time datetime="2026-03-03">2026-03-03</time>
<p>Eight official rune packages and new tooling for package authors.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-6">What's New in 0.6.0</a>
</h3>
<time datetime="2026-03-02">2026-03-02</time>
<p>A full WYSIWYG editor, framework-neutral web components, layout transform engine, AI-powered theme designer, and a Python extraction pipeline.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-5">What's New in 0.5.0</a>
</h3>
<time datetime="2026-02-23">2026-02-23</time>
<p>Theme development toolkit, behaviors library, six new runes, VS Code language server, and a major architecture shift toward framework-agnostic rendering.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-4">What's New in 0.4.0</a>
</h3>
<time datetime="2026-02-16">2026-02-16</time>
<p>New packages, seven new runes, theme restructuring, syntax highlighting, and more.</p>
</article>
</div>
</div>
</section>Grid layout
Use the layout attribute to switch between list, grid, and compact display modes.
{% blog folder="/blog" layout="grid" %}
{% /blog %}<section data-rune="blog" data-rune-fields="{"folder":"/blog","sort":"date-desc","filter":"","limit":"","layout":"grid"}">
<div data-name="posts"></div>
</section>What's New in 0.9.0
Metadata dimensions, universal theming, rune output standards, the plan package, Markdoc partials, and a Lumina design refresh.
What's New in 0.8.0
Declarative content models, a cross-page pipeline, media runes with streaming, and identity transform improvements.
What's New in 0.7.0
Eight official rune packages and new tooling for package authors.
What's New in 0.6.0
A full WYSIWYG editor, framework-neutral web components, layout transform engine, AI-powered theme designer, and a Python extraction pipeline.
What's New in 0.5.0
Theme development toolkit, behaviors library, six new runes, VS Code language server, and a major architecture shift toward framework-agnostic rendering.
What's New in 0.4.0
New packages, seven new runes, theme restructuring, syntax highlighting, and more.
<section class="rf-blog rf-blog--grid" data-layout="grid" data-sort="date-desc" data-filter="" data-limit="" data-folder="/blog" data-rune="blog" data-density="full">
<div data-name="content" class="rf-blog__content" data-section="body">
<div data-name="posts" class="rf-blog__posts">
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-9">What's New in 0.9.0</a>
</h3>
<time datetime="2026-03-30">2026-03-30</time>
<p>Metadata dimensions, universal theming, rune output standards, the plan package, Markdoc partials, and a Lumina design refresh.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-8">What's New in 0.8.0</a>
</h3>
<time datetime="2026-03-10">2026-03-10</time>
<p>Declarative content models, a cross-page pipeline, media runes with streaming, and identity transform improvements.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-7">What's New in 0.7.0</a>
</h3>
<time datetime="2026-03-03">2026-03-03</time>
<p>Eight official rune packages and new tooling for package authors.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-6">What's New in 0.6.0</a>
</h3>
<time datetime="2026-03-02">2026-03-02</time>
<p>A full WYSIWYG editor, framework-neutral web components, layout transform engine, AI-powered theme designer, and a Python extraction pipeline.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-5">What's New in 0.5.0</a>
</h3>
<time datetime="2026-02-23">2026-02-23</time>
<p>Theme development toolkit, behaviors library, six new runes, VS Code language server, and a major architecture shift toward framework-agnostic rendering.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-4">What's New in 0.4.0</a>
</h3>
<time datetime="2026-02-16">2026-02-16</time>
<p>New packages, seven new runes, theme restructuring, syntax highlighting, and more.</p>
</article>
</div>
</div>
</section>Filtering and sorting
Use filter to match against frontmatter fields and sort to control ordering. Limit the number of displayed posts with limit.
{% blog folder="/blog" sort="title-asc" limit=3 %}
{% /blog %}<section data-rune="blog" data-rune-fields="{"folder":"/blog","sort":"title-asc","filter":"","limit":"3","layout":"list"}">
<div data-name="posts"></div>
</section>What's New in 0.4.0
New packages, seven new runes, theme restructuring, syntax highlighting, and more.
What's New in 0.5.0
Theme development toolkit, behaviors library, six new runes, VS Code language server, and a major architecture shift toward framework-agnostic rendering.
What's New in 0.6.0
A full WYSIWYG editor, framework-neutral web components, layout transform engine, AI-powered theme designer, and a Python extraction pipeline.
<section class="rf-blog rf-blog--list" data-layout="list" data-sort="title-asc" data-filter="" data-limit="3" data-folder="/blog" data-rune="blog" data-density="full">
<div data-name="content" class="rf-blog__content" data-section="body">
<div data-name="posts" class="rf-blog__posts">
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-4">What's New in 0.4.0</a>
</h3>
<time datetime="2026-02-16">2026-02-16</time>
<p>New packages, seven new runes, theme restructuring, syntax highlighting, and more.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-5">What's New in 0.5.0</a>
</h3>
<time datetime="2026-02-23">2026-02-23</time>
<p>Theme development toolkit, behaviors library, six new runes, VS Code language server, and a major architecture shift toward framework-agnostic rendering.</p>
</article>
<article data-name="post" class="rf-blog__post">
<h3>
<a href="/blog/whats-new-in-0-6">What's New in 0.6.0</a>
</h3>
<time datetime="2026-03-02">2026-03-02</time>
<p>A full WYSIWYG editor, framework-neutral web components, layout transform engine, AI-powered theme designer, and a Python extraction pipeline.</p>
</article>
</div>
</div>
</section>Attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
folder | string | ✓ | Content folder path to list blog posts from (e.g. "/blog") |
sort | "date-desc" | "date-asc" | "title-asc" | "title-desc" | — | Sort order: date-desc, date-asc, title-asc, title-desc |
filter | string | — | Filter expression to match against frontmatter fields (e.g. "tag:javascript" or "draft:false") |
limit | number | — | Maximum number of posts to display |
layout | "list" | "grid" | "compact" | — | Display layout: list, grid, or compact |
Universal attributes
bg
The background layer: image, video, gradient, flat overlay wash and legibility scrim, in a single injected layer behind the rune's content.
| Attribute | Type | Required | Description |
|---|---|---|---|
bg | string | — | Background preset applied to this block |
bg-from | string | — | Gradient start colour — a semantic token name (→ var(--rf-color-*)) |
bg-gradient | "to-t" | "to-b" | "to-l" | "to-r" | "to-tr" | "to-br" | "to-bl" | "to-tl" | — | Gradient direction (bounded named set) |
bg-gradient-type | "linear" | "radial" | "conic" | — | Gradient type |
bg-to | string | — | Gradient end colour — a semantic token name |
bg-via | string | — | Optional middle gradient stop — a semantic token name |
scrim | "top" | "bottom" | "left" | "right" | "none" | — | Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim |
scrim-blur | "none" | "sm" | "md" | "lg" | — | Frost scrim blur amount |
scrim-strength | "sm" | "md" | "lg" | — | Gradient scrim strength |
scrim-tone | "dark" | "light" | — | Whether the scrim darkens (for light text) or lightens (for dark text) |
scrim-type | "gradient" | "frost" | — | Scrim treatment: gradient (default) or frost (backdrop blur) |
dropcap
Per-instance drop-cap opt-in.
| Attribute | Type | Required | Description |
|---|---|---|---|
dropcap | boolean | — | Style the opening letter of a prose body as a drop cap. Honoured only when the body reads as prose; ignored otherwise. |
elevation
How far the rune sits off the page, from sunken to overlay. The theme decides what each step looks like.
| Attribute | Type | Required | Description |
|---|---|---|---|
elevation | "sunken" | "flush" | "flat" | "raised" | "floating" | "overlay" | "none" | "sm" | "md" | "lg" | — | Surface depth, from sunken to overlay. Deprecated: none, sm, md and lg (read as flat, raised, raised and floating) |
inset
Internal padding override.
| Attribute | Type | Required | Description |
|---|---|---|---|
inset | "flush" | "tight" | "default" | "loose" | "breathe" | — | Inner padding of this block |
motion
Scroll-reveal entrance. You choose its character; the theme decides how it moves.
| Attribute | Type | Required | Description |
|---|---|---|---|
reveal | "none" | "fade" | "slide" | "scale" | "blur" | — | Scroll-reveal entrance character (none|fade|slide|scale|blur); the theme owns the choreography |
stagger | boolean | — | Cascade this block's items in as it reveals (no-op on single-child runes) |
prominence
Header emphasis. Scales a rune's header, or its featured quotation; the theme decides the type size for each step.
| Attribute | Type | Required | Description |
|---|---|---|---|
prominence | "quiet" | "normal" | "prominent" | "display" | "marquee" | — | Emphasis of a page-section header or a featured quotation (only on runes that have one) |
reading
Editorial register for body text. You pick the register; the theme decides how it looks.
| Attribute | Type | Required | Description |
|---|---|---|---|
reading | "fine" | "ui" | "prose" | — | Reading register for this block’s body: fine | ui | prose. The theme sets how each one looks. |
spacing
Block-level rhythm override.
| Attribute | Type | Required | Description |
|---|---|---|---|
spacing | "flush" | "tight" | "default" | "loose" | "breathe" | — | Vertical spacing above and below this block |
substrate
Generated pattern fills behind the content, drawn by the theme.
| Attribute | Type | Required | Description |
|---|---|---|---|
substrate | "dots" | "grid" | "lines" | "cross" | "checker" | "none" | — | Generated surface pattern |
substrate-fill | "inherit" | "inset" | — | Surface fill the pattern sits on (full colour stays with tint) |
substrate-opacity | "sm" | "md" | "lg" | — | Pattern ink strength |
substrate-size | "sm" | "md" | "lg" | — | Pattern cell size |
substrate-target | "self" | "media" | — | Which surface the pattern fills (overrides the rune/theme default) |
tint
Per-rune colour override: a named tint from the theme registry, with inline per-token overrides layered on top.
| Attribute | Type | Required | Description |
|---|---|---|---|
tint | string | — | Color tint preset applied to this block |
tint-mode | "auto" | "dark" | "light" | — | Whether the tint adapts to auto, dark, or light mode |
width
The track a block rune occupies.
| Attribute | Type | Required | Description |
|---|---|---|---|
width | "compact" | "narrow" | "content" | "wide" | "full" | — | Maximum width constraint for this block |
| Not available | Why |
|---|---|
| frame | this rune declares neither a `frameTarget` nor a media section |