feat(route): add Postman Release Notes (#10323)

This commit is contained in:
Ethan Shen
2022-07-26 00:38:18 +08:00
committed by GitHub
parent fdc5b09f90
commit c55ab4f6b8
6 changed files with 58 additions and 0 deletions
+6
View File
@@ -368,6 +368,12 @@ Refer to [#minecraft](/en/game.html#minecraft)
见 [#playstation](/game.html#playstation)
## Postman
### Release Notes
<RouteEn author="nczitzk" example="/postman/release-notes" path="/postman/release-notes"/>
## Potplayer
### Version History
+6
View File
@@ -411,6 +411,12 @@ pageClass: routes
见 [#playstation](/game.html#playstation)
## Postman
### Release Notes
<Route author="nczitzk" example="/postman/release-notes" path="/postman/release-notes"/>
## Potplayer
### 版本历史
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
'/release-notes': ['nczitzk'],
};
+13
View File
@@ -0,0 +1,13 @@
module.exports = {
'postman.com': {
_name: 'Postman',
'.': [
{
title: 'Release Notes',
docs: 'https://docs.rsshub.app/program-update.html#postman-release-notes',
source: ['/downloads/release-notes', '/'],
target: '/postman/release-notes',
},
],
},
};
+27
View File
@@ -0,0 +1,27 @@
const got = require('@/utils/got');
const md = require('markdown-it')({
html: true,
});
module.exports = async (ctx) => {
const rootUrl = 'https://www.postman.com';
const apiUrl = `${rootUrl}/mkapi/release.json`;
const currentUrl = `${rootUrl}/downloads/release-notes`;
const response = await got({
method: 'get',
url: apiUrl,
});
const items = response.data.notes.map((item) => ({
title: item.version,
link: `${currentUrl}#${item.version}`,
description: md.render(item.content),
}));
ctx.state.data = {
title: 'Release Notes | Postman',
link: currentUrl,
item: items,
};
};
+3
View File
@@ -0,0 +1,3 @@
module.exports = function (router) {
router.get('/release-notes', require('./release-notes'));
};