Aller au contenu
⌘K

Post

Voir en Markdown
Sur cette page
Cette référence API est générée à partir des commentaires TypeScript en anglais. Les noms, signatures et exemples correspondent au paquet publié.

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

NameTypeRequiredDescription
idstringYes
titlestringYes
descriptionstringNo
publishedAtstringYes
updatedAtstringNo
tagsreadonly string[]Yes
authorsreadonly AuthorProfile[]Yes
pathstringYes
urlstringYes
publicationPathstringYes
publicationNamestringYes
atomUrlstringYes
rssUrlstringYes
coverImagePostImageNo
imagesReadonly<Record<string, PostImage>>Yes
dataReadonly<Record<string, unknown>>YesFrontmatter 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.