Skip to content

Commit 8e09101

Browse files
NaturalclarMoOx
authored andcommitted
fix: edit link for split repos (#8)
1 parent 9f681b7 commit 8e09101

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

scripts/PrepareMdToJson.re

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Lowlight.(lowlight->registerLanguage("reason", reason));
88
[@bs.module] external mdToJson: string => 'a = "@phenomic/markdown-as-json";
99

1010
Js.log("Docs pages...");
11+
1112
let sourcePath = Path.join([|root, "docs"|]);
1213
let outputPath = Path.join([|root, "build", "docs-pages"|]);
1314
Path.join([|sourcePath, "**/*.md"|])
@@ -24,7 +25,12 @@ Path.join([|sourcePath, "**/*.md"|])
2425
let mdJson = mdToJson(file.content);
2526
let content =
2627
{
27-
"filename": file.name |> Js.String.replace(root, ""),
28+
"filename":
29+
file.name
30+
|> Js.String.replace(
31+
root,
32+
"reason-react-native.github.io/blob/src/",
33+
),
2834
"id": mdJson##id,
2935
"title": mdJson##title,
3036
"body": mdJson##body,
@@ -84,6 +90,10 @@ Path.join([|sourcePath, "**/*.md"|])
8490
|> Js.String.replace(
8591
Node.Path.resolve(root, "..") ++ "/",
8692
"",
93+
)
94+
|> Js.String.replace(
95+
"reason-react-native",
96+
"reason-react-native/blob/master",
8797
),
8898
"id": mdJson##id,
8999
"title": mdJson##title,
@@ -150,7 +160,12 @@ Path.join([|sourcePath, "**/*.md"|])
150160
let mdJson = mdToJson(file.content);
151161
let content =
152162
{
153-
"filename": file.name |> Js.String.replace(root, ""),
163+
"filename":
164+
file.name
165+
|> Js.String.replace(
166+
root,
167+
"reason-react-native.github.io/blob/src/",
168+
),
154169
"id": mdJson##id,
155170
"title": mdJson##title,
156171
"author": mdJson##author,

src/components/PageContent.re

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ let make = (~pageData) => {
9090
None;
9191
};
9292
let editHref =
93-
"https://github.com/reason-react-native/reason-react-native.github.io/blob/src/"
94-
++ pageData.filename;
93+
"https://github.com/reason-react-native/" ++ pageData.filename;
9594
<SpacedView style=styles##container vertical=SpacedView.L>
9695
<main>
9796
<header>

0 commit comments

Comments
 (0)