From 4935cb4516bbaaf92df5ebc69e63d208315f856b Mon Sep 17 00:00:00 2001 From: Charlie Owen Date: Wed, 7 Aug 2019 14:44:59 +0200 Subject: [PATCH 1/3] Change default docs url to RSS2 spec at W3C --- src/rss2.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rss2.ts b/src/rss2.ts index 4bab8c1..d769ef1 100644 --- a/src/rss2.ts +++ b/src/rss2.ts @@ -17,7 +17,7 @@ export default (ins: Feed) => { link: { _text: options.link }, description: { _text: options.description }, lastBuildDate: { _text: options.updated ? options.updated.toUTCString() : new Date().toUTCString() }, - docs: { _text: "http://blogs.law.harvard.edu/tech/rss" }, + docs: { _text: "https://validator.w3.org/feed/docs/rss2.html" }, generator: { _text: options.generator || generator } } } From 09eca02ec069a1aff4d4badbdd1ef1e8d4feb04e Mon Sep 17 00:00:00 2001 From: Charlie Owen Date: Wed, 7 Aug 2019 14:56:57 +0200 Subject: [PATCH 2/3] Catch all instances of harvard law blog --- src/rss2.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rss2.ts b/src/rss2.ts index d769ef1..ecbc7fb 100644 --- a/src/rss2.ts +++ b/src/rss2.ts @@ -33,7 +33,7 @@ export default (ins: Feed) => { /** * Channel Image - * http://cyber.law.harvard.edu/rss/rss.html#ltimagegtSubelementOfLtchannelgt + * https://validator.w3.org/feed/docs/rss2.html#ltimagegtSubelementOfLtchannelgt */ if (options.image) { base.rss.channel.image = { @@ -45,7 +45,7 @@ export default (ins: Feed) => { /** * Channel Copyright - * http://cyber.law.harvard.edu/rss/rss.html#optionalChannelElements + * https://validator.w3.org/feed/docs/rss2.html#optionalChannelElements */ if (options.copyright) { base.rss.channel.copyright = { _text: options.copyright }; @@ -53,7 +53,7 @@ export default (ins: Feed) => { /** * Channel Categories - * http://cyber.law.harvard.edu/rss/rss.html#comments + * https://validator.w3.org/feed/docs/rss2.html#comments */ ins.categories.map(category => { if (!base.rss.channel.category) { @@ -99,7 +99,7 @@ export default (ins: Feed) => { /** * Channel Categories - * http://cyber.law.harvard.edu/rss/rss.html#hrelementsOfLtitemgt + * https://validator.w3.org/feed/docs/rss2.html#hrelementsOfLtitemgt */ base.rss.channel.item = []; @@ -134,7 +134,7 @@ export default (ins: Feed) => { } /** * Item Author - * http://cyber.law.harvard.edu/rss/rss.html#ltauthorgtSubelementOfLtitemgt + * https://validator.w3.org/feed/docs/rss2.html#ltauthorgtSubelementOfLtitemgt */ if (Array.isArray(entry.author)) { item.author = []; From 4669338cff9ef5238d04d462d2c35648e6bd3f11 Mon Sep 17 00:00:00 2001 From: Charlie Owen Date: Wed, 7 Aug 2019 15:02:41 +0200 Subject: [PATCH 3/3] Add ability to override docs option --- src/rss2.ts | 2 +- src/typings/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rss2.ts b/src/rss2.ts index ecbc7fb..c430efb 100644 --- a/src/rss2.ts +++ b/src/rss2.ts @@ -17,7 +17,7 @@ export default (ins: Feed) => { link: { _text: options.link }, description: { _text: options.description }, lastBuildDate: { _text: options.updated ? options.updated.toUTCString() : new Date().toUTCString() }, - docs: { _text: "https://validator.w3.org/feed/docs/rss2.html" }, + docs: { _text: options.docs ? options.docs : "https://validator.w3.org/feed/docs/rss2.html" }, generator: { _text: options.generator || generator } } } diff --git a/src/typings/index.ts b/src/typings/index.ts index 6e6ea2b..8155d4b 100644 --- a/src/typings/index.ts +++ b/src/typings/index.ts @@ -36,6 +36,7 @@ export interface FeedOptions { feed?: string; feedLinks?: any; hub?: string; + docs?: string; author?: Author; link?: string;