(type, posts)
| 115 | } |
| 116 | |
| 117 | function buildFeed(type, posts) { |
| 118 | const feedItems = []; |
| 119 | |
| 120 | feedItems.push( |
| 121 | ...posts.map(function (post) { |
| 122 | const feedItem = { |
| 123 | item: [ |
| 124 | {title: post.title}, |
| 125 | {pubDate: new Date(post.date).toUTCString()}, |
| 126 | { |
| 127 | guid: [ |
| 128 | {_attr: {isPermaLink: true}}, |
| 129 | `https://react-spectrum.adobe.com/${type}/${post.fileName}.html` |
| 130 | ] |
| 131 | }, |
| 132 | { |
| 133 | description: { |
| 134 | _cdata: post.description |
| 135 | } |
| 136 | } |
| 137 | ] |
| 138 | }; |
| 139 | return feedItem; |
| 140 | }) |
| 141 | ); |
| 142 | |
| 143 | return feedItems; |
| 144 | } |