api #

blog software from scratch with SvelteKit

11 modules ยท 24 declarations

Modules
#

blog_feed_context
#

blog.ts view source

{ get: (error_message?: string | undefined) => BlogFeed; get_maybe: () => BlogFeed | undefined; set: (value: BlogFeed) => BlogFeed; } import {blog_feed_context} from '@fuzdev/fuz_blog/blog.js';

BlogComments
#

blog.ts view source

MastodonBlogComments import type {BlogComments} from '@fuzdev/fuz_blog/blog.js';

url

type string

type

type "mastodon"

BlogFeed
#

blog.ts view source

BlogFeed import type {BlogFeed} from '@fuzdev/fuz_blog/blog.js';

inheritance

extends: Feed

items

type Array<BlogPostItem>

BlogFeedData
#

blog.ts view source

BlogFeedData import type {BlogFeedData} from '@fuzdev/fuz_blog/blog.js';

id

type string

title

type string

home_page_url

type string

description

type string

icon

type string

favicon

type string

author

type { name: string; url?: string | undefined; email?: string | undefined; }

atom

type { feed_url: string; }

BlogModule
#

BlogPost
#

BlogPost.svelte view source

accepts children

import BlogPost from '@fuzdev/fuz_blog/BlogPost.svelte';

post

attrs?

type HTMLAttributes<HTMLElement>
optional

footer?

type Snippet<[]>
optional

separator?

type Snippet<[]>
optional default default_separator

children

type Snippet<[]>

BlogPostData
#

blog.ts view source

BlogPostData import type {BlogPostData} from '@fuzdev/fuz_blog/blog.js';

The author-defined data for each post.

title

type string

slug

type string

date_published

type string

date_modified

type string

summary

type string

tags?

type Array<string>

comments?

type BlogComments

BlogPostHeader
#

BlogPostId
#

blog.ts view source

BlogPostId import type {BlogPostId} from '@fuzdev/fuz_blog/blog.js';

intersects

Flavored<number, 'BlogPostId'>

BlogPostItem
#

blog.ts view source

BlogPostItem import type {BlogPostItem} from '@fuzdev/fuz_blog/blog.js';

inheritance

extends: BlogPostData

id

Blog post path with blog_post_id.

type string

url

Blog post path with slug.

type string

blog_post_id

Incrementing 1-based integer.

type BlogPostId

tags

type Array<string>

BlogPostModule
#

collect_blog_post_ids
#

blog_helpers.ts view source

(blog_dir: string): BlogPostId[] import {collect_blog_post_ids} from '@fuzdev/fuz_blog/blog_helpers.js';

Returns an array of all of the sequential blog post ids starting with 1. When it fails to find the next id, the sequence ends.

blog_dir

type string

returns

BlogPostId[]

create_atom_feed
#

feed.ts view source

(data: Feed): string import {create_atom_feed} from '@fuzdev/fuz_blog/feed.js';

data

type Feed

returns

string

Feed
#

feed.ts view source

Feed import type {Feed} from '@fuzdev/fuz_blog/feed.js';

This is designed to extend JSON Feed 1.1 with namespaced data for other specs like Atom. It's still a work in progress, and I'll add features as I need them, and eventually this will be extracted to a standalone library. https://www.jsonfeed.org/version/1.1/

id

type string

title

type string

home_page_url

type string

description

type string

icon

type string

favicon

type string

author

type { name: string; url?: string; email?: string; }

items

type Array<FeedItem>

atom

type { feed_url: string; }

FeedItem
#

feed.ts view source

FeedItem import type {FeedItem} from '@fuzdev/fuz_blog/feed.js';

id

type string

title

type string

url

type string

date_published

type string

date_modified

type string

summary

type string

tags?

type Array<string>

FeedItemDate
#

format_date
#

util.ts view source

(date: string | number | Date): string import {format_date} from '@fuzdev/fuz_blog/util.js';

date

type string | number | Date

returns

string

HashLink
#

load_blog_post_modules
#

blog_helpers.ts view source

(blog_dir: string, blog_post_ids: BlogPostId[]): Promise<BlogPostModule[]> import {load_blog_post_modules} from '@fuzdev/fuz_blog/blog_helpers.js';

blog_dir

type string

blog_post_ids

type BlogPostId[]

returns

Promise<BlogPostModule[]>

MastodonBlogComments
#

blog.ts view source

MastodonBlogComments import type {MastodonBlogComments} from '@fuzdev/fuz_blog/blog.js';

url

type string

type

type 'mastodon'

resolve_blog_post_item
#

blog_helpers.ts view source

(blog_post_id: BlogPostId, blog_url: string, post: BlogPostData): BlogPostItem import {resolve_blog_post_item} from '@fuzdev/fuz_blog/blog_helpers.js';

blog_post_id

blog_url

type string

post

returns

BlogPostItem

to_blog_post_path
#

blog_helpers.ts view source

(blog_dir: string, blog_post_id: BlogPostId): string import {to_blog_post_path} from '@fuzdev/fuz_blog/blog_helpers.js';

blog_dir

type string

blog_post_id

returns

string

to_next_blog_post_id
#

blog_helpers.ts view source

(blog_post_ids: BlogPostId[]): BlogPostId import {to_next_blog_post_id} from '@fuzdev/fuz_blog/blog_helpers.js';

blog_post_ids

type BlogPostId[]

returns

BlogPostId

to_pathname
#

util.ts view source

(url: string, root: string): string import {to_pathname} from '@fuzdev/fuz_blog/util.js';

url

type string

root

type string

returns

string