Skip to content

Commit 9d64eca

Browse files
committed
Update plugin
1 parent 14f21b5 commit 9d64eca

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

runme-badge-plugin.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,23 @@ const runmePlugin = ({ repository }) => {
2323
}
2424

2525
visit(ast, "heading", (node, index, parent) => {
26-
parent.children.splice(index, 0, {
27-
type: "link",
28-
url: `https://runme.dev/api/runme?repository=${encodeURIComponent(
29-
repository
30-
)}&fileToOpen=${markdownPath}`,
31-
title: "Open with runme",
26+
parent.children.splice(index + 1, 0, {
27+
type: "paragraph",
3228
children: [
3329
{
34-
type: "image",
30+
type: "link",
31+
url: `https://runme.dev/api/runme?repository=${encodeURIComponent(
32+
repository
33+
)}&fileToOpen=${markdownPath}`,
3534
title: "Open with runme",
36-
url: "https://badgen.net/badge/Open%20with/Runme/5B3ADF?icon=https://runme.dev/img/logo.svg",
37-
alt: "Runme badget",
35+
children: [
36+
{
37+
type: "image",
38+
title: "Open with runme",
39+
url: "https://badgen.net/badge/Open%20with/Runme/5B3ADF?icon=https://runme.dev/img/logo.svg",
40+
alt: "Runme badget",
41+
},
42+
],
3843
},
3944
],
4045
});

0 commit comments

Comments
 (0)