| 1 |
--- |
| 2 |
title: "Extensions" |
| 3 |
description: "Add SSE, WebSockets, file downloads, and more." |
| 4 |
thumbnail: "docs/extensions.svg" |
| 5 |
--- |
| 6 |
|
| 7 |
import { getFolder } from '../../lib/content'; |
| 8 |
|
| 9 |
export const folder = await getFolder('extensions'); |
| 10 |
export const CATEGORY_ORDER = ['Networking', 'Performance', 'UX', 'Swap behaviors', 'Compatibility', 'Security']; |
| 11 |
export const grouped = CATEGORY_ORDER.map(category => ({ |
| 12 |
category, |
| 13 |
slug: category.toLowerCase().replace(/\s+/g, '-'), |
| 14 |
items: folder.files.filter(f => f.frontmatter.category === category).map(f => ({ |
| 15 |
title: f.frontmatter.title, |
| 16 |
url: f.url, |
| 17 |
description: f.frontmatter.description, |
| 18 |
icon: f.frontmatter.icon, |
| 19 |
})), |
| 20 |
})).filter(g => g.items.length > 0); |
| 21 |
|
| 22 |
<div class="not-prose mb-6"> |
| 23 |
<input |
| 24 |
type="text" |
| 25 |
placeholder="Search extensions..." |
| 26 |
autocomplete="off" |
| 27 |
class="w-full px-3 py-2 text-sm border border-neutral-200 dark:border-neutral-800 rounded-md bg-white dark:bg-neutral-900 text-neutral-800 dark:text-neutral-200 placeholder:text-neutral-400 dark:placeholder:text-neutral-500 focus:outline-none focus:ring-2 focus:ring-neutral-300/50 dark:focus:ring-neutral-600/50 focus:border-neutral-300 dark:focus:border-neutral-600" |
| 28 |
_="install ActiveSearch" |
| 29 |
/> |
| 30 |
</div> |
| 31 |
|
| 32 |
{grouped.map(group => ( |
| 33 |
<section role="group"> |
| 34 |
|
| 35 |
<h2 id={group.slug}>{group.category}</h2> |
| 36 |
|
| 37 |
<table> |
| 38 |
<tbody> |
| 39 |
{group.items.map(item => ( |
| 40 |
<tr class="stretch-link" data-filter={`${item.title} ${item.description || ''}`.toLowerCase()}> |
| 41 |
<td> |
| 42 |
{item.icon && <i class={`${item.icon} size-5 inline-block align-middle mr-5`}></i>} |
| 43 |
<span class="inline-block align-middle"> |
| 44 |
<a href={item.url}><code>{item.title}</code></a> |
| 45 |
{item.description && <span class="block sm:hidden text-[0.8125em] text-neutral-650 dark:text-neutral-350 mt-0.5 pl-[6px]">{item.description}</span>} |
| 46 |
</span> |
| 47 |
</td> |
| 48 |
<td class="hidden sm:table-cell text-neutral-650 dark:text-neutral-350">{item.description || ''}</td> |
| 49 |
</tr> |
| 50 |
))} |
| 51 |
</tbody> |
| 52 |
</table> |
| 53 |
|
| 54 |
</section> |
| 55 |
))} |