feat: 2 rules for feed validation (#2825)

This commit is contained in:
Cloud
2019-08-11 01:30:59 +08:00
committed by DIYgod
parent 081a038f4a
commit 4d9c9c08e7
3 changed files with 5 additions and 3 deletions
+1
View File
@@ -57,6 +57,7 @@ module.exports = async (ctx, next) => {
lastBuildDate: new Date().toUTCString(),
updated: new Date().toISOString(),
ttl: routeTtl,
atomlink: ctx.request.header.host + ctx.request.path,
...ctx.state.data,
};
if (template) {
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<generator>RSSHub</generator>
<webMaster>i@diygod.me</webMaster>
<webMaster>i@diygod.me (DIYgod)</webMaster>
<language>{{ language || 'zh-cn' }}</language>
<id>{{ id || link }}</id>
<title><![CDATA[{{@ title || 'RSSHub' }}]]></title>
+3 -2
View File
@@ -2,14 +2,15 @@
{{ if itunes_author }}
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
{{else}}
<rss version="2.0">
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
{{ /if }}
<channel>
<title><![CDATA[{{@ title || 'RSSHub' }}]]></title>
<link>{{ link || 'https://github.com/DIYgod/RSSHub' }}</link>
<atom:link href="{{ atomlink }}" rel="self" type="application/rss+xml" />
<description><![CDATA[{{@ description || title }} - Made with love by RSSHub(https://github.com/DIYgod/RSSHub)]]></description>
<generator>RSSHub</generator>
<webMaster>i@diygod.me</webMaster>
<webMaster>i@diygod.me (DIYgod)</webMaster>
{{ if itunes_author }}<itunes:author>{{ itunes_author}}</itunes:author>{{ /if }}
{{ if itunes_category }}<itunes:category text="{{ itunes_category }}"/>{{ /if }}
<language>{{ language || 'zh-cn' }}</language>