blog.ts view source
(blog_post_id: BlogPostId, home_page_url: string, post: { [x: string]: unknown; title: string; slug: string; date_published: string; date_modified: string; summary: string; tags?: string[] | undefined; comments?: { ...; } | undefined; }, options?: { ...; } | undefined): { ...; } import {resolve_blog_feed_item} from '@fuzdev/fuz_blog/blog.js'; Derives a BlogFeedItem (the feed entry) from a post and its blog's
home_page_url. Emits only BlogFeedItem fields - a consumer's extra post
metadata stays on the page's post for its component to render, and does not
leak into the typed generated feed.
blog_post_id
the post's incrementing 1-based id
home_page_url
the blog's index url, from its feed.home_page_url
type string
post
the author-defined post metadata
type { [x: string]: unknown; title: string; slug: string; date_published: string; date_modified: string; summary: string; tags?: string[] | undefined; comments?: { url: string; type: "mastodon"; } | undefined; }
options?
slug_routes: false makes url the integer-id id
type { slug_routes?: boolean | undefined; } | undefined
optional
returns
{ tags: string[]; title: string; slug: string; date_published: string; date_modified: string; summary: string; id: string; url: string; pathname: string; blog_post_id: number; comments?: { url: string; type: "mastodon"; } | undefined; }