import { html } from 'hono/html'; import type { FC } from 'hono/jsx'; import type { Data } from '@/types'; const RSS: FC<{ data: Data }> = ({ data }) => { const hasItunes = data.itunes_author || data.itunes_category || (data.item && data.item.some((i) => i.itunes_item_image || i.itunes_duration)); const hasMedia = data.item?.some((i) => i.media); const hasAuthor = data.item?.some((i) => i.author); const isTelegramLink = data.link?.startsWith('https://t.me/s/'); return ( {html`${data.title || 'RSSHub'}`} {html`${data.link || 'https://docs.rsshub.app'}`} {data.description || data.title} - Powered by RSSHub RSSHub contact@rsshub.app (RSSHub) {data.itunes_author && {data.itunes_author}} {data.itunes_category && } {data.itunes_author && {data.itunes_explicit || 'false'}} {data.language || 'en'} {data.image && ( {data.image} {html`${data.title || 'RSSHub'}`} {html`${data.link}`} {isTelegramLink && ( <> 31 88 )} )} {data.lastBuildDate} {data.ttl} {data.item?.map((item) => ( {html`${item.title}`} {item.description} {html`${item.link}`} {item.guid || item.link || item.title} {item.pubDate && {item.pubDate}} {item.author && {item.author}} {item.image && !item.enclosure_url && !item.attachments?.length && } {item.itunes_item_image && } {item.enclosure_url && } {!item.enclosure_url && item.attachments?.slice(0, 1).map((attachment) => )} {item.itunes_duration && {item.itunes_duration}} {item.category !== undefined && (Array.isArray(item.category) ? item.category : [item.category]).map((c) => {c})} {item.media && Object.entries(item.media).map(([key, value]) => { const Tag = `media:${key}`; return ; })} ))} ); }; export default RSS;