Skip to content

fix(plugins): eliminate 8,200+ sidebar 301s by reconciling arborescence titles with canonical allPlugins titles#4577

Open
vfanucci wants to merge 3 commits intomainfrom
fix/plugin-sidebar-301-canonical-titles
Open

fix(plugins): eliminate 8,200+ sidebar 301s by reconciling arborescence titles with canonical allPlugins titles#4577
vfanucci wants to merge 3 commits intomainfrom
fix/plugin-sidebar-301-canonical-titles

Conversation

@vfanucci
Copy link
Copy Markdown
Contributor

Summary

  • Root cause identified: PluginSidebar.vue and PluginElements.vue build subgroup URLs from arborescencePlugins[i].title (via /plugins/arborescence API). The canonical URL validation in [...slug].astro uses allPlugins[i].title (via /plugins/subgroups API). When these two APIs return different titles for the same subgroup, the sidebar generates non-canonical slugs → 301 redirects on every plugin page.
  • Fix: In buildPluginPageProps.ts, overwrite each arborescence subgroup's title with the canonical title from allPlugins before the sidebar consumes it. allPlugins is already the source of truth for generateNavigation.ts and the route guard — this simply ensures the sidebar uses the same data.
  • Impact: Eliminates ~8,243 navigation 301s (88% of 9,346 total internal 301s found by Screaming Frog audit). The remaining ~959 are editorial links in MDX content and tracked separately in fix: 8,200+ internal navigation links pointing to 301 redirects on plugin pages #4576.

Changed file

src/utils/plugins/buildPluginPageProps.ts — 16 lines added, 1 changed

// Build a canonical title map from allPlugins (source of truth for URL slugs).
// The /plugins/subgroups API and the /plugins/arborescence API are separate endpoints
// that can return different `title` values for the same subgroup. Since
// subGroupHref() and getElementHref() both use slugify(subGroupName(plugin)) — which
// reads plugin.title — a title mismatch causes the sidebar to generate non-canonical
// URLs that trigger 301 redirects instead of serving the page directly.
const canonicalTitleBySubGroup = new Map(
    allPlugins
        .filter((p) => p.subGroup !== undefined)
        .map((p) => [p.subGroup!, p.title]),
)

const prunedRootPlugin = arborescencePlugins?.find((p) => p.subGroup === undefined)
const prunedPluginsWithoutDeprecated = (arborescencePlugins ?? []).map((p) => {
    if (!p.subGroup) return p
    const canonicalTitle = canonicalTitleBySubGroup.get(p.subGroup)
    return canonicalTitle !== undefined ? { ...p, title: canonicalTitle } : p
})

Test plan

  • Open any multi-subgroup plugin page (e.g. /plugins/plugin-slack/chat/io.kestra.plugin.slack.chat.ChatMessage) and inspect all sidebar <a href> values — none should match an old-style slug (e.g. slack-chats, docker-task-runner, cosmos-db, aws-cli, gcp-cli)
  • Verify navigation links in the sidebar resolve as 200, not 301, in DevTools Network tab
  • Check that the sidebar still renders the correct display names (the fix only changes which title is used for the URL slug, not the display label shown to users — both APIs should agree on display names too)
  • Re-run Screaming Frog after deploy and confirm the count of navigation 301s drops from ~8,243 to near zero

Closes #4576

🤖 Generated with Claude Code

vfanucci and others added 3 commits April 10, 2026 09:50
…lugin pages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… titles to eliminate 8,200+ sidebar 301s

The /plugins/arborescence API and /plugins/subgroups API can return
different `title` values for the same subgroup. Both PluginSidebar.vue
(subGroupHref) and PluginElements.vue (getElementHref) build URLs using
slugify(subGroupName(plugin)), which reads plugin.title. When the
arborescence title differs from the allPlugins title, the sidebar
generates non-canonical slugs (e.g. "slack-chats" instead of "chat"),
causing every link to trigger a 301 redirect.

Fix: before passing arborescencePlugins to the sidebar, replace each
subgroup's title with the canonical title from allPlugins (the same
source used by generateNavigation.ts and the route validation guard).
allPlugins remains the single source of truth for URL slug generation.

Closes #4576

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/frontend Needs frontend code changes kind/website Website-related change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: 8,200+ internal navigation links pointing to 301 redirects on plugin pages

1 participant