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
+10 -7
View File
@@ -1,8 +1,8 @@
import {
escapeHtml,
getGitHubUrl,
sanitizeUrl,
} from '../utils';
import { externalRepoUrl } from '../../lib/external-source';
import { renderEmptyStateHtml, renderSharedCardHtml } from './card-render';
interface PluginAuthor {
@@ -14,9 +14,12 @@ interface PluginSource {
source: string;
repo?: string;
path?: string;
ref?: string;
sha?: string;
}
export interface RenderablePlugin {
id: string;
name: string;
description?: string;
path: string;
@@ -30,6 +33,10 @@ export interface RenderablePlugin {
source?: PluginSource | null;
}
export function getPluginDetailUrl(id: string): string {
return `/plugin/${id}/`;
}
export type PluginSortOption = 'title' | 'lastUpdated';
export function sortPlugins<T extends RenderablePlugin>(
@@ -48,12 +55,7 @@ export function sortPlugins<T extends RenderablePlugin>(
}
function getExternalPluginUrl(plugin: RenderablePlugin): string {
if (plugin.source?.source === 'github' && plugin.source.repo) {
const base = `https://github.com/${plugin.source.repo}`;
return plugin.source.path && plugin.source.path !== '/' ? `${base}/tree/main/${plugin.source.path}` : base;
}
return sanitizeUrl(plugin.repository || plugin.homepage);
return externalRepoUrl(plugin.source, [plugin.repository, plugin.homepage]);
}
export function renderPluginsHtml(items: RenderablePlugin[]): string {
@@ -88,6 +90,7 @@ export function renderPluginsHtml(items: RenderablePlugin[]): string {
return renderSharedCardHtml({
title: item.name,
description: item.description || 'No description',
href: getPluginDetailUrl(item.id),
articleClassName: isExternal ? 'resource-item-external' : '',
articleAttributes: {
'data-path': item.path,