diff --git a/components/sublink.tsx b/components/sublink.tsx index 6d0fb1c..7db6a8c 100644 --- a/components/sublink.tsx +++ b/components/sublink.tsx @@ -114,7 +114,7 @@ export default function SubLink({ >
0 && "pl-4 border-l border-border ml-1.5" )} > diff --git a/lib/markdown.ts b/lib/markdown.ts index 9c1ec01..4e5a495 100644 --- a/lib/markdown.ts +++ b/lib/markdown.ts @@ -110,12 +110,12 @@ const handleCodeTitles = () => (tree: Node) => { nextElement.properties = {}; } nextElement.properties['data-title'] = titleNode.value; - + // Remove the original title div parent.children.splice(index, 1); - + // Return the same index to continue visiting from the correct position - return index; + return index; } } }); @@ -183,7 +183,9 @@ export async function getDocsTocs(slug: string) { } export function getPreviousNext(path: string) { - const index = page_routes.findIndex(({ href }) => href == `/${path}`); + // path comes in as "getting-started/introduction" but page_routes has "/docs/getting-started/introduction" + const fullPath = path ? `/docs/${path}` : "/docs"; + const index = page_routes.findIndex(({ href }) => href === fullPath); return { prev: page_routes[index - 1], next: page_routes[index + 1], @@ -241,7 +243,7 @@ const preProcess = () => (tree: Node) => { if (element?.type === "element" && element?.tagName === "pre" && element.children) { const [codeEl] = element.children as Element[]; if (codeEl.tagName !== "code" || !codeEl.children?.[0]) return; - + const textNode = codeEl.children[0] as TextNode; if (textNode.type === 'text' && textNode.value) { element.raw = textNode.value; diff --git a/public/favicon.ico b/public/favicon.ico index dd67b57..585e2fb 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ