Post
On this page
A published post. Ardo freezes the data it hands to pages and site modules, which share it, so
the arrays are read-only: sort a copy, such as [...publication.posts].sort(…).
import type { Post } from "ardo/ui"
type Post = {
id: string;
title: string;
description?: string;
publishedAt: string;
updatedAt?: string;
tags: readonly string[];
authors: readonly AuthorProfile[];
path: string;
url: string;
publicationPath: string;
publicationName: string;
atomUrl: string;
rssUrl: string;
coverImage?: PostImage;
images: Readonly<Record<string, PostImage>>;
/**
* Frontmatter fields Ardo does not know, such as a site's `nextStep`, as authored. Values are
* YAML data; check their type before use. Set on the post's own page, in the post module's
* props and `meta`; the posts of `virtual:ardo/publication` and of listing pages have `{}`, so
* one page's fields do not ship with every other page.
*/
data: Readonly<Record<string, unknown>>;
};
Properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
title | string | Yes | |
description | string | No | |
publishedAt | string | Yes | |
updatedAt | string | No | |
tags | readonly string[] | Yes | |
authors | readonly AuthorProfile[] | Yes | |
path | string | Yes | |
url | string | Yes | |
publicationPath | string | Yes | |
publicationName | string | Yes | |
atomUrl | string | Yes | |
rssUrl | string | Yes | |
coverImage | PostImage | No | |
images | Readonly<Record<string, PostImage>> | Yes | |
data | Readonly<Record<string, unknown>> | Yes | Frontmatter fields Ardo does not know, such as a site's nextStep, as authored. Values areYAML data; check their type before use. Set on the post's own page, in the post module's props and meta; the posts of virtual:ardo/publication and of listing pages have {}, soone page's fields do not ship with every other page. |