mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
feat(website): render syntax and mdx on the server (#9086)
This commit is contained in:
19
apps/website/src/hooks/useCurrentPathMeta.ts
Normal file
19
apps/website/src/hooks/useCurrentPathMeta.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
'use client';
|
||||
|
||||
import { usePathname } from 'next/navigation';
|
||||
|
||||
export function useCurrentPathMeta() {
|
||||
const pathname = usePathname();
|
||||
|
||||
if (!pathname) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const [, , , packageName, version, item] = pathname.split('/');
|
||||
|
||||
return {
|
||||
packageName,
|
||||
version,
|
||||
item,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user