diff --git a/docs/en/joinus/README.md b/docs/en/joinus/README.md index 85030f4e3e..6604d0a29d 100644 --- a/docs/en/joinus/README.md +++ b/docs/en/joinus/README.md @@ -105,11 +105,15 @@ ctx.state.data = { title: '', // The feed title link: '', // The feed link description: '', // The feed description + language: '', // The language of the channel item: [ // An article of the feed { title: '', // The article title - description: '', // The article content + author: '', // Author of the article + category: '', // Article category + // category: [''], // Multiple category + description: '', // The article summury or content pubDate: '', // The article publishing datetime guid: '', // The article unique identifier, optional, default to the article link below link: '', // The article link @@ -136,11 +140,15 @@ ctx.state.data = { itunes_category: '', // Channel category image: '', // Channel's image description: '', // The feed description + language: '', // The language of the channel item: [ // An item of the feed { title: '', // The item title - description: '', // The item content + author: '', // Author of the article + category: '', // Article category + // category: [''], // Multiple category + description: '', // The article summury or content pubDate: '', // The item publishing datetime guid: '', // The item unique identifier, optional, default to the item link below. link: '', // The item link diff --git a/docs/joinus/README.md b/docs/joinus/README.md index e290199d32..db05a0f40e 100644 --- a/docs/joinus/README.md +++ b/docs/joinus/README.md @@ -261,11 +261,15 @@ ctx.state.data = { title: '', // 项目的标题 link: '', // 指向项目的链接 description: '', // 描述项目 + language: '', // 频道语言 item: [ // 其中一篇文章或一项内容 { title: '', // 文章标题 - description: '', // 文章内容或描述 + author: '', // 文章作者 + category: '', // 文章分类 + // category: [''], // 多个分类 + description: '', // 文章摘要或全文 pubDate: '', // 文章发布时间 guid: '', // 文章唯一标示, 必须唯一, 可选, 默认为文章链接 link: '', // 指向文章的链接 @@ -292,11 +296,15 @@ ctx.state.data = { itunes_category: '', // 播客分类 image: '', // 专辑图片, 作为播客源时必填 description: '', // 描述项目 + language: '', // 频道语言 item: [ // 其中一篇文章或一项内容 { title: '', // 文章标题 - description: '', // 文章内容或描述 + author: '', // 文章作者 + category: '', // 文章分类 + // category: [''], // 多个分类 + description: '', // 文章摘要或全文 pubDate: '', // 文章发布时间 guid: '', // 文章唯一标示, 必须唯一, 可选, 默认为文章链接 link: '', // 指向文章的链接 diff --git a/views/atom.art b/views/atom.art index fa879eeb62..aad5c38ee8 100644 --- a/views/atom.art +++ b/views/atom.art @@ -2,7 +2,7 @@ RSSHub i@diygod.me - zh-cn + {{ language || 'zh-cn' }} {{ id || link }} <![CDATA[{{@ title || 'RSSHub' }}]]> @@ -58,8 +58,12 @@ {{ /if }} - {{ if $e.category }} + {{ if typeof $e.category === 'string' }} + {{ else }} + {{ each $e.category $c }} + + {{ /each }} {{ /if }} diff --git a/views/rss.art b/views/rss.art index 6546490a21..6cc0ec52ee 100644 --- a/views/rss.art +++ b/views/rss.art @@ -12,7 +12,7 @@ i@diygod.me {{ if itunes_author }}{{ itunes_author}}{{ /if }} {{ if itunes_category }}{{ /if }} - zh-cn + {{ language || 'zh-cn' }} {{ if image }} {{ image }} @@ -33,7 +33,13 @@ {{ if $value.enclosure_url }}{{ /if }} {{ if $value.itunes_duration }}{{ $value.itunes_duration }} {{ /if }} {{ if $value.author }}{{ /if }} - {{ if $value.category }}{{ $value.category }}{{ /if }} + {{ if typeof $value.category === 'string' }} + {{ $value.category }} + {{ else }} + {{ each $value.category $c }} + {{ $c }} + {{ /each }} + {{ /if }} {{ /each }}