+ {isIntegrations + ? t(locale, 'Integration Hub', '集成中心') + : t(locale, 'Cookbooks', '实践指南')} +
+{description}
+{group.entries.length} {t(locale, 'items', '项')}
+{descriptionOf(entry)}
+ {entry.kind === 'integration' ? ( + + ) : ( + + )} + + {entry.kind === 'integration' + ? t(locale, 'View integration', '查看集成') + : t(locale, 'View cookbook', '查看指南')} + + + ))} +{t(locale, 'Explore all 100+ plugins →', '浏览全部 100+ 插件 →')}
+{t(locale, 'Explore integrations →', '浏览集成 →')}
diff --git a/next/src/layouts/EcosystemDetail.astro b/next/src/layouts/EcosystemDetail.astro new file mode 100644 index 0000000000000..16ab6eb953f3a --- /dev/null +++ b/next/src/layouts/EcosystemDetail.astro @@ -0,0 +1,195 @@ +--- +import Base from './Base.astro'; +import { + localize, + verificationLabels, + type VerificationStatus, +} from '../lib/ecosystem'; +import { SITE, localePrefix, t, type Locale } from '../lib/site'; + +interface Props { + locale: Locale; + kind: 'integration' | 'cookbook'; + title: string; + description: string; + path: string; + category: string; + verification: VerificationStatus; + owner: string; + apisixVersion: string; + externalVersion?: string; + lastVerified?: string; + verificationUrl?: string; + reviewedAt: string; + evidenceUrl: string; + protocols?: string[]; + difficulty?: string; + duration?: string; +} + +const { + locale, + kind, + title, + description, + path, + category, + verification, + owner, + apisixVersion, + externalVersion, + lastVerified, + verificationUrl, + reviewedAt, + evidenceUrl, + protocols = [], + difficulty, + duration, +} = Astro.props; +const p = localePrefix(locale); +const hubPath = kind === 'integration' ? '/integrations/' : '/cookbooks/'; +const hubLabel = kind === 'integration' + ? t(locale, 'Integrations', '集成') + : t(locale, 'Cookbooks', 'Cookbook'); + +const articleSchema = { + '@context': 'https://schema.org', + '@type': 'TechArticle', + headline: title, + description, + url: `${SITE}${p}${path}`, + mainEntityOfPage: `${SITE}${p}${path}`, + inLanguage: locale === 'zh' ? 'zh-CN' : 'en', + about: { + '@type': 'SoftwareApplication', + name: kind === 'integration' ? 'Apache APISIX integration' : 'Apache APISIX cookbook', + applicationCategory: 'DeveloperApplication', + }, + author: { + '@type': 'Organization', + name: 'Apache APISIX', + url: SITE, + }, + publisher: { + '@type': 'Organization', + name: 'Apache APISIX', + url: SITE, + }, + isPartOf: { + '@type': 'CollectionPage', + name: hubLabel, + url: `${SITE}${p}${hubPath}`, + }, + dateModified: lastVerified ?? reviewedAt, +}; +const breadcrumbSchema = { + '@context': 'https://schema.org', + '@type': 'BreadcrumbList', + itemListElement: [ + { '@type': 'ListItem', position: 1, name: 'Apache APISIX', item: `${SITE}${p}/` }, + { '@type': 'ListItem', position: 2, name: hubLabel, item: `${SITE}${p}${hubPath}` }, + { '@type': 'ListItem', position: 3, name: title, item: `${SITE}${p}${path}` }, + ], +}; +--- +{category}
+{description}
+