Fix plugin slug in list view (#5099)

This commit is contained in:
Robert Kaussow 2025-04-17 11:14:12 +02:00 committed by GitHub
parent 6d344c847b
commit 53cd585e9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -56,6 +56,7 @@ async function loadContent(): Promise<Content> {
return {
name: docsHeader.name,
slug: slugify(docsHeader.name, { lower: true, strict: true }),
url: docsHeader.url,
icon: docsHeader.icon,
description: docsHeader.description,
@ -92,7 +93,7 @@ async function contentLoaded({
const pluginJsonPath = await createData(`plugin-${i}.json`, JSON.stringify(plugin));
addRoute({
path: `/plugins/${slugify(plugin.name, { lower: true, strict: true })}`,
path: `/plugins/${plugin.slug}`,
component: '@theme/WoodpeckerPlugin',
modules: {
plugin: pluginJsonPath,

View File

@ -8,7 +8,7 @@ import { WoodpeckerPlugin } from '../types';
import { IconPlugin, IconVerified } from './Icons';
function PluginPanel({ plugin }: { plugin: WoodpeckerPlugin }) {
const pluginUrl = `/plugins/${plugin.name}`;
const pluginUrl = `/plugins/${plugin.slug}`;
return (
<a href={pluginUrl} className="card shadow--md wp-plugin-card">

View File

@ -17,6 +17,7 @@ export type WoodpeckerPluginIndexEntry = {
export type WoodpeckerPlugin = WoodpeckerPluginHeader & {
name: string;
slug: string;
docs: string; // body of the docs .md file
verified: boolean; // we set verified to false when not explicitly set
iconDataUrl?: string;