mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-10 15:21:59 +08:00
@@ -14,12 +14,14 @@ module.exports = async (ctx) => {
|
||||
|
||||
const $ = cheerio.load(data);
|
||||
const item = $('.routeBlock').get();
|
||||
return Promise.resolve(item);
|
||||
return Promise.resolve({ item, type });
|
||||
})
|
||||
);
|
||||
let list = [];
|
||||
all.forEach((item) => {
|
||||
list = list.concat(item);
|
||||
const list = [];
|
||||
all.forEach(({ item, type }) => {
|
||||
item.forEach((item) => {
|
||||
list.unshift({ item, type });
|
||||
});
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
@@ -28,7 +30,7 @@ module.exports = async (ctx) => {
|
||||
description: '万物皆可 RSS',
|
||||
item:
|
||||
list &&
|
||||
list.reverse().map((item) => {
|
||||
list.map(({ item, type }) => {
|
||||
item = cheerio(item);
|
||||
item.find('.header-anchor').remove();
|
||||
const titleEle = item.prevAll('h2').eq(0);
|
||||
@@ -39,7 +41,7 @@ module.exports = async (ctx) => {
|
||||
.eq(0)
|
||||
.text()}`,
|
||||
description: item.html(),
|
||||
link: `https://docs.rsshub.app#${encodeURIComponent(
|
||||
link: `https://docs.rsshub.app/${type}.html#${encodeURIComponent(
|
||||
titleEle.find('.header-anchor').attr('href') &&
|
||||
titleEle
|
||||
.find('.header-anchor')
|
||||
|
||||
Reference in New Issue
Block a user