fix(route): rsshub routes (#13235)

This commit is contained in:
Tony
2023-09-08 22:46:51 +08:00
committed by GitHub
parent 31c0aa715e
commit 31684c9480
2 changed files with 7 additions and 5 deletions
+6 -4
View File
@@ -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);
+1 -1
View File
@@ -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}