feat(route): add Postman Release Notes (#10323)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
### 版本历史
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/release-notes': ['nczitzk'],
|
||||
};
|
||||
@@ -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',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -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,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = function (router) {
|
||||
router.get('/release-notes', require('./release-notes'));
|
||||
};
|
||||
Reference in New Issue
Block a user