From 398be0f592200df3396468b160f1276654a68e29 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 1 Mar 2024 01:21:28 +0800 Subject: [PATCH] feat: rename routes dir - 1/2 --- .dockerignore | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/labeler.yml | 12 ++++++------ .github/workflows/docker-release.yml | 3 +-- lib/errors/index.test.ts | 4 ++-- lib/routes.ts | 8 ++++---- lib/utils/wechat-mp.ts | 16 ++++++++-------- package.json | 2 -- scripts/workflow/build-maintainer.js | 2 +- scripts/workflow/build-radar.js | 2 +- scripts/workflow/test-issue/call-maintainer.js | 8 ++++---- website/docs/install/config.md | 2 +- website/docs/joinus/advanced/debug.md | 2 +- website/docs/joinus/advanced/script-standard.md | 12 ++++++------ website/docs/joinus/new-radar.md | 2 +- website/docs/joinus/new-rss/before-start.md | 2 +- website/docs/joinus/new-rss/submit-route.md | 4 ++-- website/docs/joinus/quick-start.md | 2 +- .../current/install/config.md | 2 +- .../current/joinus/advanced/debug.md | 2 +- .../current/joinus/advanced/script-standard.md | 12 ++++++------ .../current/joinus/new-radar.md | 2 +- .../current/joinus/new-rss/before-start.md | 2 +- .../current/joinus/new-rss/submit-route.md | 2 +- .../current/joinus/quick-start.md | 2 +- 25 files changed, 54 insertions(+), 57 deletions(-) diff --git a/.dockerignore b/.dockerignore index 8f99edcc77..a57f9f33c9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -43,4 +43,4 @@ vercel.json .git/hooks # rsshub auxiliary files -lib/v2/**/radar.js +lib/routes/**/radar.js diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cc44504344..ed2b027469 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -32,7 +32,7 @@ If your changes are not related to route, please fill in `routes` section with ` ## New RSS Route Checklist / 新 RSS 路由检查表 - [ ] New Route / 新的路由 - - [ ] Follows [v2 Script Standard](https://docs.rsshub.app/joinus/advanced/script-standard) / 跟随 [v2 路由规范](https://docs.rsshub.app/zh/joinus/advanced/script-standard) + - [ ] Follows [Script Standard](https://docs.rsshub.app/joinus/advanced/script-standard) / 跟随 [路由规范](https://docs.rsshub.app/zh/joinus/advanced/script-standard) - [ ] Documentation / 文档说明 - [ ] Full text / 全文获取 - [ ] Use cache / 使用缓存 diff --git a/.github/labeler.yml b/.github/labeler.yml index a8b075766e..f858c6c820 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,16 +1,16 @@ -'Route: v1': +'Route: deprecated': - changed-files: - any-glob-to-any-file: ['lib/router.js'] - - all-globs-to-any-file: ['lib/routes/**/*.js', '!lib/routes/index.js'] + - all-globs-to-any-file: ['lib/routes-deprecated/**/*.js', '!lib/routes-deprecated/index.js'] -'Route: v2': +'Route': - changed-files: - - any-glob-to-any-file: ['lib/v2/**/*.js'] + - any-glob-to-any-file: ['lib/routes/**/*.js'] core enhancement: - changed-files: - - any-glob-to-any-file: ['lib/routes/index.js'] - - all-globs-to-any-file: ['lib/**', '!/lib/config.js', '!lib/router.js', '!lib/routes/**', '!lib/v2/**'] + - any-glob-to-any-file: ['lib/routes/index.ts'] + - all-globs-to-any-file: ['lib/**', '!/lib/config.ts', '!lib/routes/**'] dependencies: - changed-files: diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index c41f05a583..1602d2c413 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -9,8 +9,7 @@ on: - 'lib/**' - '!**/maintainer.js' - '!**/radar.js' - - '!lib/v2/test/**' - - '!test/**' + - '!lib/**/*.test.ts' - 'Dockerfile' workflow_dispatch: {} diff --git a/lib/errors/index.test.ts b/lib/errors/index.test.ts index 11326e7072..1c58350c33 100644 --- a/lib/errors/index.test.ts +++ b/lib/errors/index.test.ts @@ -37,8 +37,8 @@ describe('RequestInProgressError', () => { }); }); -describe('v2 route throws an error', () => { - it('v2 route path error should have path mounted', async () => { +describe('route throws an error', () => { + it('route path error should have path mounted', async () => { await request.get('/test/error'); await request.get('/thisDoesNotExist'); const response = await request.get('/'); diff --git a/lib/routes.ts b/lib/routes.ts index d43706f7b4..314ff617b9 100644 --- a/lib/routes.ts +++ b/lib/routes.ts @@ -3,15 +3,15 @@ import type { Hono, Handler } from 'hono'; import { serveStatic } from '@hono/node-server/serve-static'; import * as path from 'node:path'; -import index from '@/v2/index'; -import robotstxt from '@/v2/robots.txt'; +import index from '@/routes/index'; +import robotstxt from '@/routes/robots.txt'; type Root = { get: (routePath: string, filePath: string) => void; }; const imports = directoryImport({ - targetDirectoryPath: path.join(__dirname, './v2'), + targetDirectoryPath: path.join(__dirname, './routes'), importPattern: /router\.js$/, }); @@ -31,7 +31,7 @@ export default function (app: Hono) { get: (routePath, filePath) => { const wrapedHandler: Handler = async (ctx, ...args) => { if (!ctx.get('data')) { - const handler = require(path.join(__dirname, 'v2', name, filePath)); + const handler = require(path.join(__dirname, 'routes', name, filePath)); await handler(ctx, ...args); } }; diff --git a/lib/utils/wechat-mp.ts b/lib/utils/wechat-mp.ts index 2f847df79f..ae03957b8d 100644 --- a/lib/utils/wechat-mp.ts +++ b/lib/utils/wechat-mp.ts @@ -2,14 +2,14 @@ * Author: @Rongronggg9 * * There are at least three folders which are relevant with WeChat MP (Official Account Platform / Media Platform): - * lib/v2/wechat - * lib/v2/gov/npma - * lib/v2/gzh360 - * lib/v2/pku/nsd/gd - * lib/v2/sdu/cs - * lib/v2/nua/utils - * lib/v2/hrbeu - * lib/v2/freewechat + * lib/routes/wechat + * lib/routes/gov/npma + * lib/routes/gzh360 + * lib/routes/pku/nsd/gd + * lib/routes/sdu/cs + * lib/routes/nua/utils + * lib/routes/hrbeu + * lib/routes/freewechat * * If your new route is not in the above folders, please add it to the list. * diff --git a/package.json b/package.json index 65e3599bcd..105997d41a 100644 --- a/package.json +++ b/package.json @@ -54,8 +54,6 @@ "lib/**/*.js", "lib/**/*.ts", "!lib/routes/**", - "!lib/v2/**", - "!lib/v3/**", "!lib/router.js" ], "coverageReporters": [ diff --git a/scripts/workflow/build-maintainer.js b/scripts/workflow/build-maintainer.js index 3fc93becd4..c2511ad470 100644 --- a/scripts/workflow/build-maintainer.js +++ b/scripts/workflow/build-maintainer.js @@ -1,7 +1,7 @@ const fs = require('fs'); const path = require('path'); const target = path.join(__dirname, '../../assets/build/maintainer.json'); -const dirname = path.join(__dirname + '../../../lib/v2'); +const dirname = path.join(__dirname + '../../../lib/routes'); // Presence Check for (const dir of fs.readdirSync(dirname)) { diff --git a/scripts/workflow/build-radar.js b/scripts/workflow/build-radar.js index ffd3552533..d26e8be725 100644 --- a/scripts/workflow/build-radar.js +++ b/scripts/workflow/build-radar.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const targetJs = path.join(__dirname, '../../assets/build/radar-rules.js'); const targetJson = path.join(__dirname, '../../assets/build/radar-rules.json'); -const dirname = path.join(__dirname + '../../../lib/v2'); +const dirname = path.join(__dirname + '../../../lib/routes'); const toSource = require('tosource'); // Namespaces that do not require radar.js diff --git a/scripts/workflow/test-issue/call-maintainer.js b/scripts/workflow/test-issue/call-maintainer.js index f6afba19b1..406ba9f25f 100644 --- a/scripts/workflow/test-issue/call-maintainer.js +++ b/scripts/workflow/test-issue/call-maintainer.js @@ -8,8 +8,8 @@ const maintainerURL = 'https://raw.githubusercontent.com/DIYgod/RSSHub/gh-pages/ const successTag = 'Bug Ping: Pinged'; const parseFailTag = 'Bug Ping: Parsing Failed'; const failTag = 'Bug Ping: Not Found'; -const v1route = 'Route: v1'; -const v2route = 'Route: v2'; +const deprecatedRoute = 'Route: deprecated'; +const route = 'Route'; // DnD (do-not-disturb) usernames, add yours here to avoid being notified const dndUsernames = new Set([]); @@ -147,11 +147,11 @@ module.exports = async ({ github, context, core }) => { } if (emptyCount > 0) { - labels.push(v1route); + labels.push(deprecatedRoute); } if (successCount > 0) { - labels.push(v2route); + labels.push(route); } // Write labels (status, affected route count) diff --git a/website/docs/install/config.md b/website/docs/install/config.md index 09fe92beb7..a80eb46194 100644 --- a/website/docs/install/config.md +++ b/website/docs/install/config.md @@ -493,7 +493,7 @@ Remember to check `user-top-read` and `user-library-read` in the scope for `Pers [Bot application](https://telegram.org/blog/bot-revolution) - `TELEGRAM_TOKEN`: Telegram bot token for stickerpack feeds -- `TELEGRAM_SESSION`: for video and file streaming, can be acquired by running `node lib/v2/telegram/tglib/client.js` +- `TELEGRAM_SESSION`: for video and file streaming, can be acquired by running `node lib/routes/telegram/tglib/client.js` ### Twitter diff --git a/website/docs/joinus/advanced/debug.md b/website/docs/joinus/advanced/debug.md index 26b8e8f887..1d99ec2780 100644 --- a/website/docs/joinus/advanced/debug.md +++ b/website/docs/joinus/advanced/debug.md @@ -16,7 +16,7 @@ To pass a custom object to `ctx.set('json', obj)` for debugging, follow these st 2. Pass your object to `ctx.set('json', obj)`. 3. Access the corresponding route + `.debug.json` to view your object. For example, if you want to debug the route `/furstar/characters/:lang?`, you can access the URL: `/furstar/characters/en.debug.json` -Here's an example of how to use `ctx.set('json', obj)` taken from [furstar/index.js](https://github.com/DIYgod/RSSHub/blob/master/lib/v2/furstar/index.js) +Here's an example of how to use `ctx.set('json', obj)` taken from [furstar/index.js](https://github.com/DIYgod/RSSHub/blob/master/lib/routes/furstar/index.js) ```js const info = utils.fetchAllCharacters(res.data, base); diff --git a/website/docs/joinus/advanced/script-standard.md b/website/docs/joinus/advanced/script-standard.md index 1ee6d8c19c..61c239aa73 100644 --- a/website/docs/joinus/advanced/script-standard.md +++ b/website/docs/joinus/advanced/script-standard.md @@ -63,9 +63,9 @@ sidebar_position: 2 - Use `kebab-case` for files and folders. - Use `CONSTANT_CASE` for constants. -## v2 Route Standard +## Route Standard -When creating a new route in RSSHub, you need to organize your files in a specific way. Your namespace folder should be stored in the `lib/v2` directory and should include three mandatory files: +When creating a new route in RSSHub, you need to organize your files in a specific way. Your namespace folder should be stored in the `lib/routes` directory and should include three mandatory files: - `router.js` Registers the routes - `maintainer.js` Provides information about the route maintainer @@ -74,7 +74,7 @@ When creating a new route in RSSHub, you need to organize your files in a specif Your namespace folder structure should look like this: ``` -├───lib/v2 +├───lib/routes │ ├───furstar │ ├─── templates │ ├─── description.art @@ -87,7 +87,7 @@ Your namespace folder structure should look like this: ... ``` -**All eligible routes under the `lib/v2` path will be automatically loaded without the need for updating the `lib/router.js`.** +**All eligible routes under the `lib/routes` path will be automatically loaded without the need for updating the `lib/router.js`.** ### Namespace @@ -137,7 +137,7 @@ All templates should be placed in the namespace's `templates` folder with the `. #### Example -Here's an example taken from the [furstar](https://github.com/DIYgod/RSSHub/blob/master/lib/v2/furstar) namespace: +Here's an example taken from the [furstar](https://github.com/DIYgod/RSSHub/blob/master/lib/routes/furstar) namespace: ```html
@@ -160,6 +160,6 @@ const renderAuthor = (author) => art(path.join(__dirname, 'templates/author.art' :::danger -The v1 Route Standard is deprecated. All new routes should be following the [v2 Route Standard](/joinus/advanced/script-standard#v2-route-standard). +The v1 Route Standard is deprecated. All new routes should be following the [Route Standard](/joinus/advanced/script-standard#route-standard). ::: diff --git a/website/docs/joinus/new-radar.md b/website/docs/joinus/new-radar.md index abb98cd289..efad178136 100644 --- a/website/docs/joinus/new-radar.md +++ b/website/docs/joinus/new-radar.md @@ -8,7 +8,7 @@ If you want to see the results, we suggest you install the browser extension. Yo ## Code the rule -To create a new RSS feed, create a file called `radar.js` under the corresponding namespace in [/lib/v2/](https://github.com/DIYgod/RSSHub/tree/master/lib/v2). We will continue to use the example of creating an RSS feed for `GitHub Repo Issues`, which is described [here](/joinus/new-rss/before-start). The resulting code will look like this: +To create a new RSS feed, create a file called `radar.js` under the corresponding namespace in [/lib/routes/](https://github.com/DIYgod/RSSHub/tree/master/lib/routes). We will continue to use the example of creating an RSS feed for `GitHub Repo Issues`, which is described [here](/joinus/new-rss/before-start). The resulting code will look like this: ```js module.exports = { diff --git a/website/docs/joinus/new-rss/before-start.md b/website/docs/joinus/new-rss/before-start.md index 1244b57d21..4843f30a03 100644 --- a/website/docs/joinus/new-rss/before-start.md +++ b/website/docs/joinus/new-rss/before-start.md @@ -76,7 +76,7 @@ Before submitting your Pull Request, make sure to carefully review the [Script S ## Create a namespace -The first step in creating a new RSS route is to create a namespace. The namespace should be the **same** as the second level domain name of the main website for which you are creating the RSS feed. For example, if you are creating an RSS feed for [https://github.com/DIYgod/RSSHub/issues](https://github.com/DIYgod/RSSHub/issues), the second level domain name is `github`. Therefore, you should create a folder called `github` under `lib/v2` to serve as the namespace for your RSS route. +The first step in creating a new RSS route is to create a namespace. The namespace should be the **same** as the second level domain name of the main website for which you are creating the RSS feed. For example, if you are creating an RSS feed for [https://github.com/DIYgod/RSSHub/issues](https://github.com/DIYgod/RSSHub/issues), the second level domain name is `github`. Therefore, you should create a folder called `github` under `lib/routes` to serve as the namespace for your RSS route. :::tip diff --git a/website/docs/joinus/new-rss/submit-route.md b/website/docs/joinus/new-rss/submit-route.md index dac2d72d13..b0b9b43a34 100644 --- a/website/docs/joinus/new-rss/submit-route.md +++ b/website/docs/joinus/new-rss/submit-route.md @@ -41,7 +41,7 @@ If your changes are not related to route, please fill in `routes` section with ` ## New RSS Route Checklist / 新 RSS 路由检查表 - [ ] New Route / 新的路由 - - [ ] Follows [v2 Script Standard](https://docs.rsshub.app/joinus/advanced/script-standard) / 跟随 [v2 路由规范](https://docs.rsshub.app/zh/joinus/advanced/script-standard) + - [ ] Follows [Script Standard](https://docs.rsshub.app/joinus/advanced/script-standard) / 跟随 [路由规范](https://docs.rsshub.app/zh/joinus/advanced/script-standard) - [ ] Documentation / 文档说明 - [ ] Full text / 全文获取 - [ ] Use cache / 使用缓存 @@ -89,7 +89,7 @@ NOROUTE ### New RSS Route Checklist -This checklist will help you ensure that your pull request includes all necessary components. Although you don't have to check off all items to get your PR merged, please make sure that your new route follows the [v2 Script Standard](/joinus/advanced/script-standard). This is a **mandatory** requirement for all new routes. +This checklist will help you ensure that your pull request includes all necessary components. Although you don't have to check off all items to get your PR merged, please make sure that your new route follows the [Script Standard](/joinus/advanced/script-standard). This is a **mandatory** requirement for all new routes. ```md - [ ] 新的路由 New Route diff --git a/website/docs/joinus/quick-start.md b/website/docs/joinus/quick-start.md index b51c2aae63..8d29e7f29c 100644 --- a/website/docs/joinus/quick-start.md +++ b/website/docs/joinus/quick-start.md @@ -20,7 +20,7 @@ If you don't know much about them but would like to learn them, here are some go - [W3Schools](https://www.w3schools.com/) - [Git course on Codecademy](https://www.codecademy.com/learn/learn-git) -If you'd like to see examples of how other developers use these technologies to create RSS feeds, you can take a look at some of the code in [our repository](https://github.com/DIYgod/RSSHub/tree/master/lib/v2). +If you'd like to see examples of how other developers use these technologies to create RSS feeds, you can take a look at some of the code in [our repository](https://github.com/DIYgod/RSSHub/tree/master/lib/routes). ## Submit new RSSHub rules diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/install/config.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/install/config.md index 057ef5c937..3eb9be8242 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/install/config.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/install/config.md @@ -472,7 +472,7 @@ RSSHub 支持使用访问密钥 / 码,允许清单和拒绝清单三种方式 贴纸包路由:[Telegram 机器人](https://telegram.org/blog/bot-revolution) - `TELEGRAM_TOKEN`: Telegram 机器人 token -- `TELEGRAM_SESSION`: 可通过运行 `node lib/v2/telegram/tglib/client.js` +- `TELEGRAM_SESSION`: 可通过运行 `node lib/routes/telegram/tglib/client.js` ### Twitter diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/advanced/debug.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/advanced/debug.md index be44341938..4c8dc3632c 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/advanced/debug.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/advanced/debug.md @@ -16,7 +16,7 @@ sidebar_position: 5 2. 将对象传递给 `ctx.set('json', obj)`。 3. 访问相应的路由 + `.debug.json` 来查看您的对象。例如,如果您想调试 `/furstar/characters/en`,您可以访问 URL:`/furstar/characters/en.debug.json`。 -以下是来自 [furstar/index.js](https://github.com/DIYgod/RSSHub/blob/master/lib/v2/furstar/index.js) 的使用 `ctx.set('json', obj)` 的示例: +以下是来自 [furstar/index.js](https://github.com/DIYgod/RSSHub/blob/master/lib/routes/furstar/index.js) 的使用 `ctx.set('json', obj)` 的示例: ```js const info = utils.fetchAllCharacters(res.data, base); diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/advanced/script-standard.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/advanced/script-standard.md index dc44f2ddc8..ead9099dc5 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/advanced/script-standard.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/advanced/script-standard.md @@ -63,9 +63,9 @@ sidebar_position: 2 - 使用 `kebab-case` 命名文件和文件夹。 - 使用 `CONSTANT_CASE` 命名常量。 -## v2 路由规范 +## 路由规范 -当在 RSSHub 中编写新的路由时,需要按特定方式组织文件。命名空间文件夹应该存储在 `lib/v2` 目录下,并且应包括三个必需文件: +当在 RSSHub 中编写新的路由时,需要按特定方式组织文件。命名空间文件夹应该存储在 `lib/routes` 目录下,并且应包括三个必需文件: - `router.js` 注册路由 - `maintainer.js` 提供路由维护者信息 @@ -73,7 +73,7 @@ sidebar_position: 2 命名空间文件夹结构应该像这样: - ├───lib/v2 + ├───lib/routes │ ├───furstar │ ├─── templates │ ├─── description.art @@ -85,7 +85,7 @@ sidebar_position: 2 │ └───someOtherNamespaces ... -**所有符合条件的,在 `lib/v2` 路径下的路由将会被自动载入,无需更新 `lib/router.js`** +**所有符合条件的,在 `lib/routes` 路径下的路由将会被自动载入,无需更新 `lib/router.js`** ### 命名空间 @@ -135,7 +135,7 @@ RSSHub 会将所有路由命名空间的文件夹名附加到路由前面。路 #### 示例 -下面是在 [furstar](https://github.com/DIYgod/RSSHub/blob/master/lib/v2/furstar) 命名空间中示例: +下面是在 [furstar](https://github.com/DIYgod/RSSHub/blob/master/lib/routes/furstar) 命名空间中示例: @@ -162,6 +162,6 @@ const renderAuthor = (author) => art(path.join(__dirname, 'templates/author.art' :::danger -v1 路由规范已被弃用。所有新路由都应遵循 [v2 路由规范](#v2-lu-you-gui-fan)。 +v1 路由规范已被弃用。所有新路由都应遵循 [路由规范](#lu-you-gui-fan)。 ::: diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-radar.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-radar.md index 499c4e3b89..316e054a8f 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-radar.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-radar.md @@ -8,7 +8,7 @@ sidebar_position: 3 ## 编写规则 -要制作新的 RSSHub Radar 规则,需要在 `/lib/v2/` 目录下,相应的域名空间创建 `radar.js` 文件。下面以制作 `GitHub 仓库 Issues` 的 RSS 源为例,详见此处。编写的代码应如下所示: +要制作新的 RSSHub Radar 规则,需要在 `/lib/routes/` 目录下,相应的域名空间创建 `radar.js` 文件。下面以制作 `GitHub 仓库 Issues` 的 RSS 源为例,详见此处。编写的代码应如下所示: ```js module.exports = { diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/before-start.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/before-start.md index 70c57771f5..020841def8 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/before-start.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/before-start.md @@ -76,7 +76,7 @@ npm run dev ## 创建命名空间 -制作新的 RSS 路由的第一步是创建命名空间。命名空间应该与您制作 RSS 源的主要网站的二级域名**相同**。例如,如果您正在为 [https://github.com/DIYgod/RSSHub/issues](https://github.com/DIYgod/RSSHub/issues) 制作 RSS 源,第二级域名是 `github`。因此,您应该在 `lib/v2` 下创建名为 `github` 的文件夹,作为您的 RSS 路由的命名空间。 +制作新的 RSS 路由的第一步是创建命名空间。命名空间应该与您制作 RSS 源的主要网站的二级域名**相同**。例如,如果您正在为 [https://github.com/DIYgod/RSSHub/issues](https://github.com/DIYgod/RSSHub/issues) 制作 RSS 源,第二级域名是 `github`。因此,您应该在 `lib/routes` 下创建名为 `github` 的文件夹,作为您的 RSS 路由的命名空间。 :::tip diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/submit-route.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/submit-route.md index ae63ee275e..23880c9990 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/submit-route.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/submit-route.md @@ -41,7 +41,7 @@ If your changes are not related to route, please fill in `routes` with `NOROUTE` ## New RSS Route Checklist / 新 RSS 路由检查表 - [ ] New Route / 新的路由 - - [ ] Follows [v2 Script Standard](https://docs.rsshub.app/joinus/advanced/script-standard) / 跟随 [v2 路由规范](https://docs.rsshub.app/zh/joinus/advanced/script-standard) + - [ ] Follows [Script Standard](https://docs.rsshub.app/joinus/advanced/script-standard) / 跟随 [路由规范](https://docs.rsshub.app/zh/joinus/advanced/script-standard) - [ ] Documentation / 文档说明 - [ ] Full text / 全文获取 - [ ] Use cache / 使用缓存 diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/quick-start.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/quick-start.md index 48e5c87803..dbe5f9fb5c 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/quick-start.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/quick-start.md @@ -20,7 +20,7 @@ sidebar_position: 1 - [W3Schools](https://www.w3schools.com) - [Codecademy 上的 Git 课程](https://www.codecademy.com/learn/learn-git) -如果您想查看其他开发人员如何使用这些技术来制作 RSS 订阅的示例,您可以查看 [我们的代码库](https://github.com/DIYgod/RSSHub/tree/master/lib/v2) 中的一些代码。 +如果您想查看其他开发人员如何使用这些技术来制作 RSS 订阅的示例,您可以查看 [我们的代码库](https://github.com/DIYgod/RSSHub/tree/master/lib/routes) 中的一些代码。 ## 提交新的 RSSHub 规则