WIP! A BB-style forum, on the ATmosphere!
We're still working... we'll be back soon when we have something to show off!
node
typescript
hono
htmx
atproto
1/**
2 * Derives a URL-friendly slug from a display name.
3 * Lowercases, collapses non-alphanumeric runs to hyphens, strips leading/trailing hyphens.
4 *
5 * Examples:
6 * "My Cool Category" → "my-cool-category"
7 * " Off-Topic Chat! " → "off-topic-chat"
8 */
9export function deriveSlug(name: string): string {
10 return name
11 .toLowerCase()
12 .replace(/[^a-z0-9]+/g, "-")
13 .replace(/^-|-$/g, "");
14}