feat: Implement Algolia DocSearch, enhance MDX components, and update build configurations.

This commit is contained in:
gitfromwildan
2026-02-08 23:10:20 +07:00
parent 8b3de652bb
commit 099c384d9d
43 changed files with 1617 additions and 1156 deletions

View File

@@ -32,9 +32,6 @@ export default function SubLink({
// Full path including parent's href
const fullHref = `${parentHref}${href}`;
// Check if current path exactly matches this link's href
const isExactActive = useMemo(() => path === fullHref, [path, fullHref]);
// Check if any child is active (for parent items)
const hasActiveChild = useMemo(() => {
if (!items) return false;
@@ -47,6 +44,7 @@ export default function SubLink({
// Auto-expand if current path is a child of this item
useEffect(() => {
if (items && (path.startsWith(fullHref) && path !== fullHref)) {
// eslint-disable-next-line react-hooks/set-state-in-effect
setIsOpen(true);
}
}, [path, fullHref, items]);
@@ -88,7 +86,7 @@ export default function SubLink({
<div className={cn("flex flex-col gap-1 w-full")}>
<Collapsible open={isOpen} onOpenChange={setIsOpen}>
<CollapsibleTrigger
className="w-full pr-5 text-left"
className="w-full pr-5 text-left cursor-pointer"
aria-expanded={isOpen}
aria-controls={`collapsible-${fullHref.replace(/[^a-zA-Z0-9]/g, '-')}`}
>