IRssService
katanakit-js / IRssService
Interface: IRssService
Section titled “Interface: IRssService”Defined in: types/adapters/rss.ts:18
Contract of the RSS facade.
Methods
Section titled “Methods”useCreateRssEndpoint()
Section titled “useCreateRssEndpoint()”useCreateRssEndpoint(config): (context) => Promise<Response>;Defined in: types/adapters/rss.ts:24
Generates an Astro GET endpoint handler for the RSS feed.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
config |
Omit<{ customData?: string; description: string; items: { author?: string; categories?: string[]; content?: string; customData?: string; description?: string; link: string; pubDate: string | Date; title: string; }[]; language?: string; lastBuildDate?: boolean; site: string; title: string; trailingSlash?: boolean; xmlPath?: string; xslUrl?: string; }, "items"> & { items: | { author?: string; categories?: string[]; content?: string; customData?: string; description?: string; link: string; pubDate: string | Date; title: string; }[] | (() => | { author?: string; categories?: string[]; content?: string; customData?: string; description?: string; link: string; pubDate: string | Date; title: string; }[] | Promise<{ author?: string; categories?: string[]; content?: string; customData?: string; description?: string; link: string; pubDate: string | Date; title: string; }[]>); } |
Returns
Section titled “Returns”(context) => Promise<Response>
useCreateRssEndpointFromConfig()
Section titled “useCreateRssEndpointFromConfig()”useCreateRssEndpointFromConfig(siteConfig, items): (context) => Promise<Response>;Defined in: types/adapters/rss.ts:28
Convenience: creates an RSS endpoint from a SiteConfig.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
siteConfig |
SiteConfig |
items |
| { author?: string; categories?: string[]; content?: string; customData?: string; description?: string; link: string; pubDate: string | Date; title: string; }[] | (() => | { author?: string; categories?: string[]; content?: string; customData?: string; description?: string; link: string; pubDate: string | Date; title: string; }[] | Promise<{ author?: string; categories?: string[]; content?: string; customData?: string; description?: string; link: string; pubDate: string | Date; title: string; }[]>) |
Returns
Section titled “Returns”(context) => Promise<Response>
useGenerateRss()
Section titled “useGenerateRss()”useGenerateRss(config): RssResult;Defined in: types/adapters/rss.ts:20
Generates the RSS XML string from a config.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
config |
{ customData?: string; description: string; items: { author?: string; categories?: string[]; content?: string; customData?: string; description?: string; link: string; pubDate: string | Date; title: string; }[]; language?: string; lastBuildDate?: boolean; site: string; title: string; trailingSlash?: boolean; xmlPath?: string; xslUrl?: string; } |
- |
config.customData? |
string |
Custom XML to inject into the <channel> element. |
config.description? |
string |
Description of the feed. |
config.items? |
{ author?: string; categories?: string[]; content?: string; customData?: string; description?: string; link: string; pubDate: string | Date; title: string; }[] |
Feed items. |
config.language? |
string |
Language code (default: “en”). |
config.lastBuildDate? |
boolean |
Whether to include the <lastBuildDate> (default: true). |
config.site? |
string |
Base URL of the site (e.g. “https://example.com”). |
config.title? |
string |
Title of the feed (e.g. “My Blog”). |
config.trailingSlash? |
boolean |
Trailing slash behavior for item links (default: true). |
config.xmlPath? |
string |
Output path (default: “/rss.xml”). |
config.xslUrl? |
string |
XSL stylesheet URL for browser rendering (optional). |
Returns
Section titled “Returns”useRssLinkTag()
Section titled “useRssLinkTag()”useRssLinkTag(config): string;Defined in: types/adapters/rss.ts:22
Generates an HTML <link> tag for the RSS feed.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
config |
Pick<RssConfig, "title" | "xmlPath"> |
Returns
Section titled “Returns”string