fix(radar): link radar rules to the route namespace page

close #17785
This commit is contained in:
Tony
2026-09-25 03:13:19 +08:00
parent 27ef2dd36d
commit 0a3a66a1cb
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -22,3 +22,10 @@ describe('api/radar/rules/one', () => {
expect(text).toBe('');
});
});
describe('api/radar/rules/docs', () => {
it('links docs to the route namespace page', async () => {
const rules = await getRadarRules();
expect(rules['github.com']['.'][0].docs).toBe('https://docs.rsshub.app/routes/github');
});
});
+1 -1
View File
@@ -34,7 +34,7 @@ export const getRadarRules = async (): Promise<Record<string, RadarDomain>> => {
}
rules[domain][subdomain].push({
title: radarItem.title || data.name,
docs: `https://docs.rsshub.app/routes/${data.categories?.[0] || 'other'}`,
docs: `https://docs.rsshub.app/routes/${namespace}`,
source: radarItem.source.map((source) => {
const sourceURL = new URL('https://' + source);
return sourceURL.pathname + sourceURL.search + sourceURL.hash;