mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix(route): rsshub routes (#13235)
This commit is contained in:
@@ -2,7 +2,9 @@ const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const lang = ctx.params.lang === 'en' ? 'en/' : '';
|
||||
const isEnglish = ctx.params.lang !== 'zh';
|
||||
|
||||
const lang = isEnglish ? '' : 'zh/';
|
||||
const types = [
|
||||
'social-media',
|
||||
'new-media',
|
||||
@@ -43,10 +45,10 @@ module.exports = async (ctx) => {
|
||||
const list = all.flatMap(({ page, item, type }) => item.map((item) => ({ page, item, type })));
|
||||
|
||||
ctx.state.data = {
|
||||
title: lang === 'en/' ? 'RSSHub has new routes' : 'RSSHub 有新路由啦',
|
||||
title: isEnglish ? 'RSSHub has new routes' : 'RSSHub 有新路由啦',
|
||||
link: 'https://docs.rsshub.app',
|
||||
description: lang === 'en/' ? 'Everything is RSSible' : '万物皆可 RSS',
|
||||
language: lang === 'en/' ? 'en-us' : 'zh-cn',
|
||||
description: isEnglish ? 'Everything is RSSible' : '万物皆可 RSS',
|
||||
language: isEnglish ? 'en-us' : 'zh-cn',
|
||||
item: list.map(({ page, item, type }) => {
|
||||
const $ = cheerio.load(page);
|
||||
item = $(item);
|
||||
|
||||
@@ -580,7 +580,7 @@ Logseq 开发团队已经放弃了 [旧网站](https://logseq.com/blog)。
|
||||
|
||||
### New routes {#rsshub-new-routes}
|
||||
|
||||
<Route author="DIYgod" path="/rsshub/routes/:lang?" example="/rsshub/routes/en" paramsDesc={['Language, `en` means English routes, other values or null means Chinese routes']}/>
|
||||
<Route author="DIYgod" path="/rsshub/routes/:lang?" example="/rsshub/routes/en" paramsDesc={['Language, `zh` means Chinese docs, other values or null means English docs, `en` by default']}/>
|
||||
|
||||
### New sponsors {#rsshub-new-sponsors}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user