modify sublink.tsx, markdown.ts and favicon.icon
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user