fix(radar): link build-routes docs to the route namespace page

The docs site only builds pages for namespace keys, so the category
links written into radar-rules.json/js pointed at missing pages.
0a3a66a1c fixed the API rules; do the same for the build output.

Refs #17785
This commit is contained in:
pseudoyu
2026-10-14 20:27:29 +08:00
parent 60dd77d757
commit 68a110994a
+1 -16
View File
@@ -40,25 +40,10 @@ const allRoutePaths = new Set<string>();
// Use all namespaces for both regular and Worker builds.
for (const namespace in namespaces) {
const namespaceData = namespaces[namespace];
let defaultCategory = namespaceData.categories?.[0];
if (!defaultCategory) {
for (const path in namespaceData.routes) {
if (!namespaceData.routes[path].categories) {
continue;
}
defaultCategory = namespaceData.routes[path].categories[0];
break;
}
}
if (!defaultCategory) {
defaultCategory = 'other';
}
for (const path in namespaceData.routes) {
const realPath = `/${namespace}${path}`;
allRoutePaths.add(realPath);
const data = namespaceData.routes[path];
const categories = data.categories || namespaceData.categories || [defaultCategory];
// maintainers
if (data.maintainers) {
maintainers[realPath] = data.maintainers;
@@ -82,7 +67,7 @@ for (const namespace in namespaces) {
}
radar[domain][subdomain].push({
title: radarItem.title || data.name,
docs: `https://docs.rsshub.app/routes/${categories[0]}`,
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;