diff --git a/src/components/common/PluginsBlock.astro b/src/components/common/PluginsBlock.astro index fdf663cb0d..f7e75b3a26 100644 --- a/src/components/common/PluginsBlock.astro +++ b/src/components/common/PluginsBlock.astro @@ -21,7 +21,10 @@ const plugins = metadata .map((p) => { return { ...p, - link: `/plugins/${p.artifactId}${p.artifactId === `plugin-${p.name}` ? "" : `/${p.name}`}`, + // Logo links to the plugin group page (always 200). The previous + // `/${p.name}` suffix produced subgroup URLs that 404 for ~82 plugins + // and 301-redirect to this same group page, so we skip the hop. + link: `/plugins/${p.artifactId}`, } }) diff --git a/src/components/common/PluginsBox.astro b/src/components/common/PluginsBox.astro index 2799f446b5..9320baa4b0 100644 --- a/src/components/common/PluginsBox.astro +++ b/src/components/common/PluginsBox.astro @@ -31,11 +31,9 @@ const plugins = await Promise.all( title: plugin.title, name: plugin.name, artifactId: plugin.artifactId, - link: - `/plugins/${plugin.artifactId}` + - (`plugin-${plugin.name}` != plugin.artifactId - ? "/" + plugin.name - : ""), + // Link logos to the plugin group page (always 200) to avoid the + // 404 -> 301 hop the `/${plugin.name}` subgroup suffix caused for ~82 plugins. + link: `/plugins/${plugin.artifactId}`, group: plugin.group, } }), diff --git a/src/components/features/core/EveryPlugin.astro b/src/components/features/core/EveryPlugin.astro index 2b6dd46dc8..b8e55e59a9 100644 --- a/src/components/features/core/EveryPlugin.astro +++ b/src/components/features/core/EveryPlugin.astro @@ -26,7 +26,9 @@ try { .filter((p) => p.artifactId && !excluded.test(p.artifactId)) .map((p) => ({ ...p, - link: `/plugins/${p.artifactId}${p.artifactId === `plugin-${p.name}` ? "" : `/${p.name}`}`, + // Link logos to the plugin group page (always 200) to avoid the + // 404 -> 301 hop the `/${p.name}` subgroup suffix caused for ~82 plugins. + link: `/plugins/${p.artifactId}`, })) .sort(randomSortFunction) .slice(0, 20) diff --git a/src/contents/redirects/plugins.yml b/src/contents/redirects/plugins.yml index d9aa99cec1..bad4f0d302 100644 --- a/src/contents/redirects/plugins.yml +++ b/src/contents/redirects/plugins.yml @@ -1,3 +1,6 @@ +# Specific redirects MUST come before the catch-all below: the middleware +# applies the FIRST matching rule (notFoundRedirect -> allEntries[0]), so any +# rule placed after the catch-all "/plugins/plugin-(...)" never fires. - regexp: "/plugins/core/tasks/scripts/io.kestra.core.tasks.scripts.bash" to: "/plugins/plugin-script-shell/io.kestra.plugin.scripts.shell.script" - regexp: "/plugins/core/tasks/scripts/io.kestra.core.tasks.scripts.node" @@ -6,15 +9,17 @@ to: "/plugins/plugin-script-python/io.kestra.plugin.scripts.python.script" - regexp: "/plugins/core/triggers/io.kestra.core.models.triggers.types.webhook" to: "/plugins/core/trigger/io.kestra.plugin.core.trigger.webhook" -- regexp: "/plugins/plugin-([^/]+).*" - to: "/plugins/plugin-$1" - regexp: "/plugins/plugin-aws/io.kestra.plugin.aws.runner.batch" - to: "/plugins/plugin-ee-aws/io.kestra.plugin.ee.aws.runner.batch" -- regexp: " /plugins/plugin-azure/io.kestra.plugin.azure.runner.batch" - to: "/plugins/plugin-ee-azure/io.kestra.plugin.ee.azure.runner.batch" + to: "/plugins/plugin-ee-aws/aws-batch-task-runner/io.kestra.plugin.ee.aws.runner.batch" +- regexp: "/plugins/plugin-azure/io.kestra.plugin.azure.runner.batch" + to: "/plugins/plugin-ee-azure/azure-runner/io.kestra.plugin.ee.azure.runner.batch" - regexp: "/plugins/plugin-gcp/io.kestra.plugin.gcp.runner.batch" - to: "/plugins/plugin-ee-gcp/io.kestra.plugin.ee.gcp.runner.batch" + to: "/plugins/plugin-ee-gcp/google-cloud-task-runner/io.kestra.plugin.ee.gcp.runner.batch" - regexp: "/plugins/plugin-gcp/io.kestra.plugin.gcp.runner.cloudrun" - to: "/plugins/plugin-ee-gcp/io.kestra.plugin.ee.gcp.runner.cloudrun" + to: "/plugins/plugin-ee-gcp/google-cloud-task-runner/io.kestra.plugin.ee.gcp.runner.cloudrun" - regexp: "/plugins/plugin-kubernetes/io.kestra.plugin.kubernetes.runner.kubernetes" to: "/plugins/plugin-ee-kubernetes/io.kestra.plugin.ee.kubernetes.runner.kubernetes" +# Catch-all: any unknown plugin subgroup/task URL falls back to its group page. +# Keep this LAST so the specific rules above take precedence. +- regexp: "/plugins/plugin-([^/]+).*" + to: "/plugins/plugin-$1"