modify sublink.tsx, markdown.ts and favicon.icon
This commit is contained in:
@@ -114,7 +114,7 @@ export default function SubLink({
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
"flex flex-col items-start sm:text-sm text-foreground/80 ml-0.5 mt-2.5 gap-3 transition-colors",
|
||||
"flex flex-col items-start sm:text-sm text-foreground/80 ml-0.5 mt-1.5 gap-3 transition-colors",
|
||||
level > 0 && "pl-4 border-l border-border ml-1.5"
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 6.2 KiB |
Reference in New Issue
Block a user