chore: publish from main

This commit is contained in:
github-actions[bot]
2026-07-10 03:24:21 +00:00
parent 9a8e446f02
commit 51b6fa0253
56 changed files with 4496 additions and 992 deletions
+22 -4
View File
@@ -41,6 +41,19 @@ const TYPE_PAGES: Record<string, string> = {
tool: "/tools/",
};
// Resource types that have a dedicated detail page at /<type>/<id>/. Search
// results for these should deep-link to the canonical detail page rather than
// the listing page with an inert #file= hash (listing pages no longer open a
// modal from that hash).
const DETAIL_ROUTE_TYPES = new Set([
"agent",
"instruction",
"skill",
"hook",
"workflow",
"plugin",
]);
export default function pagefindResources(): AstroIntegration {
let siteBase = "/";
@@ -97,12 +110,17 @@ export default function pagefindResources(): AstroIntegration {
let added = 0;
for (const record of records) {
const hasDetailPage =
DETAIL_ROUTE_TYPES.has(record.type) && Boolean(record.id);
const typePage = TYPE_PAGES[record.type];
if (!typePage) continue;
// Skip records we can neither deep-link nor point at a listing page.
if (!hasDetailPage && !typePage) continue;
const url = `${base}${typePage.slice(1)}#file=${encodeURIComponent(
record.path
)}`;
const url = hasDetailPage
? `${base}${record.type}/${encodeURIComponent(record.id)}/`
: `${base}${typePage.slice(1)}#file=${encodeURIComponent(
record.path
)}`;
const typeLabel = TYPE_LABELS[record.type] || record.type;
const addResult = await index.addCustomRecord({