1
0
mirror of synced 2025-12-23 21:07:12 -05:00

Populate product-landing "What's new" section using GitHub Changelog (#18328)

Co-authored-by: Jason Etcovitch <jasonetco@github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
This commit is contained in:
Vanessa Yuen
2021-04-08 22:51:37 +02:00
committed by GitHub
parent 9b3eb7d295
commit bbd9f03f6e
43 changed files with 292 additions and 320 deletions

View File

@@ -0,0 +1,13 @@
const { getRssFeed, getChangelogItems } = require('../../lib/changelog')
module.exports = async function whatsNewChangelog (req, res, next) {
if (!req.context.page) return next()
if (!req.context.page.changelog) return next()
req.context.changelogUrl = req.context.page.changelog.label === 'education'
? 'https://github.blog/category/community/education'
: `https://github.blog/changelog/label/${req.context.page.changelog.label}`
const feed = await getRssFeed(req.context.changelogUrl)
req.context.whatsNewChangelog = await getChangelogItems(req.context.page.changelog.prefix, feed)
return next()
}