--- import Base from '../layouts/Base.astro'; import { getCollection } from 'astro:content'; export async function getStaticPaths() { const extensions = await getCollection('extensions'); return extensions.map((ext) => ({ params: { slug: ext.slug }, props: { ext }, })); } const { ext } = Astro.props; const { Content, headings } = await ext.render(); const tocItems = headings .filter((h: any) => h.depth === 2) .map((h: any) => ({ text: h.text, slug: h.slug })); const siteUrl = 'https://greasysprocket.com'; const canonicalUrl = `${siteUrl}/${ext.slug}`; const ogImage = ext.data.screenshot ? new URL(ext.data.screenshot, siteUrl).href : undefined; const categoryLabels: Record = { 'productivity': 'Productivity', 'developer-tools': 'Developer Tools', 'fun': 'Fun', 'privacy': 'Privacy', 'utilities': 'Utilities', }; const jsonLd = [ { '@context': 'https://schema.org', '@type': 'SoftwareApplication', name: ext.data.name, description: ext.data.description, applicationCategory: 'BrowserExtension', operatingSystem: 'Chrome', url: canonicalUrl, offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' }, ...(ext.data.chromeStoreUrl && { installUrl: ext.data.chromeStoreUrl }), }, { '@context': 'https://schema.org', '@type': 'BreadcrumbList', itemListElement: [ { '@type': 'ListItem', position: 1, name: 'Extensions', item: siteUrl }, { '@type': 'ListItem', position: 2, name: ext.data.name, item: canonicalUrl }, ], }, ...(ext.data.faq ? [{ '@context': 'https://schema.org', '@type': 'FAQPage', mainEntity: ext.data.faq.map((f: any) => ({ '@type': 'Question', name: f.question, acceptedAnswer: { '@type': 'Answer', text: f.answer }, })), }] : []), ]; ---
{categoryLabels[ext.data.category] || ext.data.category}
No ratings yet

{ext.data.name}

{ext.data.tagline}

{ext.data.tags.length > 0 && (
{ext.data.tags.map((tag: string) => ( {tag} ))}
)}
{ext.data.chromeStoreUrl && ( Add to Chrome )} {ext.data.downloadUrl && ( Download ZIP )}
{ext.data.screenshot && (
{`${ext.data.name}
)}
{tocItems.length > 0 && ( )}
{ext.data.features?.map((feature: string) => (

{feature}

))}

How would you rate {ext.data.name}?

Click a star to vote — no account needed.

{ext.data.faq && ext.data.faq.length > 0 && (

Frequently asked questions

{ext.data.faq.map((f: any, i: number) => (
{f.question}

{f.answer}

))}
)}