Skip to content

Commit 1726271

Browse files
committed
Refactor "Content From" part
1 parent 483737f commit 1726271

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

docs/1. intro.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ const branch = "master";
99
const readmePath = "/README.md";
1010
const rawBaseUrl = "https://raw.githubusercontent.com";
1111
const pageBaseUrl = "https://github.com";
12-
export const ReadmeLink = () => (<a href={`${pageBaseUrl}/${repo}/tree/${branch}${readmePath}`}>{repo + readmePath}</a>);
1312

14-
*Content from <ReadmeLink/>*
1513
<EmbedReadme repo={repo} branch={branch} readmePath={readmePath} rawBaseUrl={rawBaseUrl} pageBaseUrl={pageBaseUrl}/>

docs/2. Running Sourcify/1-Server.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ const branch = "master"
99
const readmePath = "/services/server/README.md";
1010
const rawBaseUrl = "https://raw.githubusercontent.com";
1111
const pageBaseUrl = "https://github.com";
12-
export const ReadmeLink = () => (<a href={`${pageBaseUrl}/${repo}/tree/${branch}${readmePath}`}>{repo + readmePath}</a>);
1312

14-
*Content from <ReadmeLink/>*
1513
<EmbedReadme repo={repo} branch={branch} readmePath={readmePath} rawBaseUrl={rawBaseUrl} pageBaseUrl={pageBaseUrl}/>

docs/2. Running Sourcify/2-UI.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ const branch = "master";
99
const readmePath = "/README.md";
1010
const rawBaseUrl = "https://raw.githubusercontent.com";
1111
const pageBaseUrl = "https://github.com";
12-
export const ReadmeLink = () => (<a href={`${pageBaseUrl}/${repo}/tree/${branch}${readmePath}`}>{repo + readmePath}</a>);
1312

14-
*Content from <ReadmeLink/>*
1513
<EmbedReadme repo={repo} branch={branch} readmePath={readmePath} rawBaseUrl={rawBaseUrl} pageBaseUrl={pageBaseUrl}/>

docs/2. Running Sourcify/3-Monitor.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ const branch = "master";
99
const readmePath = "/services/monitor/README.md";
1010
const rawBaseUrl = "https://raw.githubusercontent.com";
1111
const pageBaseUrl = "https://github.com";
12-
export const ReadmeLink = () => (<a href={`${pageBaseUrl}/${repo}/tree/${branch}${readmePath}`}>{repo + readmePath}</a>);
1312

14-
*Content from <ReadmeLink/>*
1513
<EmbedReadme repo={repo} branch={branch} readmePath={readmePath} rawBaseUrl={rawBaseUrl} pageBaseUrl={pageBaseUrl}/>

docs/EmbedReadme.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ export default function EmbedReadme({ repo, branch, readmePath, rawBaseUrl, page
3535
});
3636
}, []);
3737

38-
console.log(rawBaseUrl);
39-
4038
if (!content) return "Loading from " + rawBaseUrl + readmePath + "...";
41-
return <div dangerouslySetInnerHTML={{ __html: content }} />;
39+
return (
40+
<div>
41+
<div>
42+
<i>
43+
Content from <a href={`${pageBaseUrl}/${repo}/tree/${branch}${readmePath}`}>{repo + readmePath}</a>
44+
</i>
45+
</div>
46+
<div dangerouslySetInnerHTML={{ __html: content }} />{" "}
47+
</div>
48+
);
4249
}

0 commit comments

Comments
 (0)