refactor: Remove unused 'path' property in Section type
This commit is contained in:
parent
2e692f7264
commit
29a2246ef3
@ -2,5 +2,4 @@ export type Section = {
|
||||
id: string;
|
||||
title: string;
|
||||
level: 2 | 3;
|
||||
path: string;
|
||||
};
|
||||
|
||||
@ -124,21 +124,6 @@ const formatExportNode = (): MDXJSEsm => {
|
||||
method: false,
|
||||
shorthand: false,
|
||||
},
|
||||
{
|
||||
type: "Property",
|
||||
key: {
|
||||
type: "Identifier",
|
||||
name: "path",
|
||||
},
|
||||
value: {
|
||||
type: "Literal",
|
||||
value: section.path,
|
||||
},
|
||||
kind: "init",
|
||||
computed: false,
|
||||
method: false,
|
||||
shorthand: false,
|
||||
},
|
||||
],
|
||||
})),
|
||||
},
|
||||
@ -161,9 +146,6 @@ const remarkHeadingId: Plugin<[], Root> = () => (tree: Root, file) => {
|
||||
visit(tree, "heading", (node) => {
|
||||
const lastChild = node.children[node.children.length - 1];
|
||||
|
||||
const filePath = file.path;
|
||||
console.log(`File path: ${filePath}`);
|
||||
|
||||
if (lastChild && lastChild.type === "text") {
|
||||
const string = lastChild.value.replace(/ +$/, "");
|
||||
const matched = string.match(/ {#(.*?)}$/);
|
||||
@ -181,7 +163,6 @@ const remarkHeadingId: Plugin<[], Root> = () => (tree: Root, file) => {
|
||||
id: slug,
|
||||
title: extractText(node.children),
|
||||
level: depth,
|
||||
path: filePath,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user