From 2e037bf3c6f48ac5e66f171cca73a9b2759c0849 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 24 Mar 2024 05:15:41 +0000 Subject: [PATCH] chore: auto build https://github.com/DIYgod/RSSHub/commit/e8b0d7d2622ec43878e64706f8b89f6f1a2fee21 --- .vitepress/config/data.ts | 188 +++++++++++++++++++------------------- .vitepress/theme/types.ts | 93 ++++++++++++++++++- 2 files changed, 185 insertions(+), 96 deletions(-) diff --git a/.vitepress/config/data.ts b/.vitepress/config/data.ts index d171d07a7..dcf4cf8ff 100644 --- a/.vitepress/config/data.ts +++ b/.vitepress/config/data.ts @@ -1,140 +1,140 @@ export const categories = [ { - "icon": "💬", - "link": "/routes/social-media", - "en": "Social Media", - "zh": "社交媒体" + icon: '💬', + link: '/routes/social-media', + en: 'Social Media', + zh: '社交媒体', }, { - "icon": "📱", - "link": "/routes/new-media", - "en": "New media", - "zh": "新媒体" + icon: '📱', + link: '/routes/new-media', + en: 'New media', + zh: '新媒体', }, { - "icon": "📰", - "link": "/routes/traditional-media", - "en": "Traditional media", - "zh": "传统媒体" + icon: '📰', + link: '/routes/traditional-media', + en: 'Traditional media', + zh: '传统媒体', }, { - "icon": "💬️", - "link": "/routes/bbs", - "en": "BBS", - "zh": "论坛" + icon: '💬️', + link: '/routes/bbs', + en: 'BBS', + zh: '论坛', }, { - "icon": "🖊️️", - "link": "/routes/blog", - "en": "Blog", - "zh": "博客" + icon: '🖊️️', + link: '/routes/blog', + en: 'Blog', + zh: '博客', }, { - "icon": "💻", - "link": "/routes/programming", - "en": "Programming", - "zh": "编程" + icon: '💻', + link: '/routes/programming', + en: 'Programming', + zh: '编程', }, { - "icon": "🎨️", - "link": "/routes/design", - "en": "Design", - "zh": "设计" + icon: '🎨️', + link: '/routes/design', + en: 'Design', + zh: '设计', }, { - "icon": "🎥", - "link": "/routes/live", - "en": "Live", - "zh": "直播" + icon: '🎥', + link: '/routes/live', + en: 'Live', + zh: '直播', }, { - "icon": "🔊", - "link": "/routes/multimedia", - "en": "Multimedia", - "zh": "音视频" + icon: '🔊', + link: '/routes/multimedia', + en: 'Multimedia', + zh: '音视频', }, { - "icon": "🖼️", - "link": "/routes/picture", - "en": "Picture", - "zh": "图片" + icon: '🖼️', + link: '/routes/picture', + en: 'Picture', + zh: '图片', }, { - "icon": "🎨️", - "link": "/routes/anime", - "en": "ACG", - "zh": "二次元" + icon: '🎨️', + link: '/routes/anime', + en: 'ACG', + zh: '二次元', }, { - "icon": "🔄", - "link": "/routes/program-update", - "en": "Application Updates", - "zh": "程序更新" + icon: '🔄', + link: '/routes/program-update', + en: 'Application Updates', + zh: '程序更新', }, { - "icon": "🎓", - "link": "/routes/university", - "en": "University", - "zh": "大学通知" + icon: '🎓', + link: '/routes/university', + en: 'University', + zh: '大学通知', }, { - "icon": "❗️", - "link": "/routes/forecast", - "en": "Forecast and Alerts", - "zh": "预报预警" + icon: '❗️', + link: '/routes/forecast', + en: 'Forecast and Alerts', + zh: '预报预警', }, { - "icon": "🛫", - "link": "/routes/travel", - "en": "Travel", - "zh": "出行旅游" + icon: '🛫', + link: '/routes/travel', + en: 'Travel', + zh: '出行旅游', }, { - "icon": "🛍️", - "link": "/routes/shopping", - "en": "Shopping", - "zh": "购物" + icon: '🛍️', + link: '/routes/shopping', + en: 'Shopping', + zh: '购物', }, { - "icon": "🎮", - "link": "/routes/game", - "en": "Gaming", - "zh": "游戏" + icon: '🎮', + link: '/routes/game', + en: 'Gaming', + zh: '游戏', }, { - "icon": "📚", - "link": "/routes/reading", - "en": "Reading", - "zh": "阅读" + icon: '📚', + link: '/routes/reading', + en: 'Reading', + zh: '阅读', }, { - "icon": "📢", - "link": "/routes/government", - "en": "Government", - "zh": "政务消息" + icon: '📢', + link: '/routes/government', + en: 'Government', + zh: '政务消息', }, { - "icon": "📖", - "link": "/routes/study", - "en": "Study", - "zh": "学习" + icon: '📖', + link: '/routes/study', + en: 'Study', + zh: '学习', }, { - "icon": "🔬", - "link": "/routes/journal", - "en": "Scientific Journal", - "zh": "科学期刊" + icon: '🔬', + link: '/routes/journal', + en: 'Scientific Journal', + zh: '科学期刊', }, { - "icon": "💰", - "link": "/routes/finance", - "en": "Finance", - "zh": "金融" + icon: '💰', + link: '/routes/finance', + en: 'Finance', + zh: '金融', }, { - "icon": "🔍", - "link": "/routes/other", - "en": "Uncategorized", - "zh": "其他" - } -] \ No newline at end of file + icon: '🔍', + link: '/routes/other', + en: 'Uncategorized', + zh: '其他', + }, +]; diff --git a/.vitepress/theme/types.ts b/.vitepress/theme/types.ts index 0aa0d236e..0c7c3541c 100644 --- a/.vitepress/theme/types.ts +++ b/.vitepress/theme/types.ts @@ -1,3 +1,87 @@ +import type { Context } from 'hono'; + +// Make sure it's synchronise with scripts/workflow/data.ts +type Category = + | 'social-media' + | 'new-media' + | 'traditional-media' + | 'bbs' + | 'blog' + | 'programming' + | 'design' + | 'live' + | 'multimedia' + | 'picture' + | 'anime' + | 'program-update' + | 'university' + | 'forecast' + | 'travel' + | 'shopping' + | 'game' + | 'reading' + | 'government' + | 'study' + | 'journal' + | 'finance' + | 'other'; + +// rss +export type DataItem = { + title: string; + description?: string; + pubDate?: number | string | Date; + link?: string; + category?: string[]; + author?: string | { name: string }[]; + doi?: string; + guid?: string; + id?: string; + content?: { + html: string; + text: string; + }; + image?: string; + banner?: string; + updated?: number | string | Date; + language?: string; + enclosure_url?: string; + enclosure_type?: string; + enclosure_title?: string; + enclosure_length?: number; + itunes_duration?: number | string; + itunes_item_image?: string; + media?: Record>; + + _extra?: Record & { + links?: { + url: string; + type: string; + content_html?: string; + }[]; + }; +}; + +export type Data = { + title: string; + description?: string; + link?: string; + item?: DataItem[]; + allowEmpty?: boolean; + image?: string; + author?: string; + language?: string; + feedLink?: string; + lastBuildDate?: string; + itunes_author?: string; + itunes_category?: string; + itunes_explicit?: string | boolean; + id?: string; + + atomlink?: string; + ttl?: number; +}; + // namespace interface NamespaceItem { /** @@ -14,7 +98,7 @@ interface NamespaceItem { /** * The classification of the namespace, which will be written into the corresponding classification document */ - categories?: string[]; + categories?: Category[]; /** * Hints and additional explanations for users using this namespace, it will be inserted into the documentation @@ -56,6 +140,11 @@ interface RouteItem { */ maintainers: string[]; + /** + * The handler function of the route + */ + handler: (ctx: Context) => Promise | Data; + /** * An example URL of the route */ @@ -74,7 +163,7 @@ interface RouteItem { /** * The classification of the route, which will be written into the corresponding classification documentation */ - categories?: string[]; + categories?: Category[]; /** * Special features of the route, such as what configuration items it depends on, whether it is strict anti-crawl, whether it supports a certain function and so on