We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27a4525 commit 36ccc89Copy full SHA for 36ccc89
src/app/(main)/resources/[category]/texts.ts
@@ -146,11 +146,10 @@ export const sectionKindNames: Record<Kind, string> = {
146
docs: "Documentation",
147
}
148
149
-export function sectionId(name: string): string {
150
- return name
151
- .toLowerCase()
152
- .replace(/ & /g, "-and-")
153
- .replace(/[^a-z0-9-]/g, "")
154
- .replace(/-+/g, "-")
155
- .replace(/^-|-$/g, "")
+export function slugify(name: string): string {
+ return name.toLowerCase().replace(/ & /g, "-and-").replace(/ /g, "-")
156
+
+export const sectionIds: Record<Kind, string> = Object.fromEntries(
+ Object.entries(sectionKindNames).map(([kind, name]) => [kind, slugify(name)]),
+) as Record<Kind, string>
0 commit comments