mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-16 16:44:53 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user