@@ -17,11 +17,13 @@ export function rss(channel, data) {
1717 if ( meta . title == null ) throw new Error ( 'Expected `channel.title` to be set' )
1818 if ( meta . url == null ) throw new Error ( 'Expected `channel.url` to be set' )
1919
20- items . push ( x ( 'title' , String ( meta . title ) ) )
21- items . push ( x ( 'description' , String ( meta . description || '' ) ) )
22- items . push ( x ( 'link' , new URL ( meta . url ) . href ) )
23- items . push ( x ( 'lastBuildDate' , now . toGMTString ( ) ) )
24- items . push ( x ( 'dc:date' , now . toISOString ( ) ) )
20+ items . push (
21+ x ( 'title' , String ( meta . title ) ) ,
22+ x ( 'description' , String ( meta . description || '' ) ) ,
23+ x ( 'link' , new URL ( meta . url ) . href ) ,
24+ x ( 'lastBuildDate' , now . toGMTString ( ) ) ,
25+ x ( 'dc:date' , now . toISOString ( ) )
26+ )
2527
2628 if ( meta . feedUrl ) {
2729 atom = true
@@ -36,14 +38,12 @@ export function rss(channel, data) {
3638
3739 if ( meta . lang ) {
3840 value = bcp47 ( meta . lang )
39- items . push ( x ( 'language' , value ) )
40- items . push ( x ( 'dc:language' , value ) )
41+ items . push ( x ( 'language' , value ) , x ( 'dc:language' , value ) )
4142 }
4243
4344 if ( meta . author ) {
4445 value = '© ' + now . getUTCFullYear ( ) + ' ' + meta . author
45- items . push ( x ( 'copyright' , value ) )
46- items . push ( x ( 'dc:rights' , value ) )
46+ items . push ( x ( 'copyright' , value ) , x ( 'dc:rights' , value ) )
4747 }
4848
4949 if ( meta . tags ) {
@@ -79,21 +79,24 @@ export function rss(channel, data) {
7979
8080 if ( datum . url ) {
8181 value = new URL ( datum . url ) . href
82- children . push ( x ( 'link' , value ) )
83-
84- // Do not treat it as a URL, just an opaque identifier.
85- // `<link>` is already used by readers for the URL.
86- // Now, the value we have here is a URL, but we can’t know if it’s
87- // “permanent”, so, set `false`.
88- children . push ( x ( 'guid' , { isPermaLink : 'false' } , value ) )
82+ children . push (
83+ x ( 'link' , value ) ,
84+ // Do not treat it as a URL, just an opaque identifier.
85+ // `<link>` is already used by readers for the URL.
86+ // Now, the value we have here is a URL, but we can’t know if it’s
87+ // “permanent”, so, set `false`.
88+ x ( 'guid' , { isPermaLink : 'false' } , value )
89+ )
8990 }
9091
9192 value = datum . published
9293
9394 if ( value != null ) {
9495 if ( typeof value !== 'object' ) value = new Date ( value )
95- children . push ( x ( 'pubDate' , value . toGMTString ( ) ) )
96- children . push ( x ( 'dc:date' , value . toISOString ( ) ) )
96+ children . push (
97+ x ( 'pubDate' , value . toGMTString ( ) ) ,
98+ x ( 'dc:date' , value . toISOString ( ) )
99+ )
97100 }
98101
99102 value = datum . modified
0 commit comments