Skip to content

Commit ce1684f

Browse files
committed
Rework links
1 parent ee5283c commit ce1684f

File tree

9 files changed

+61
-22
lines changed

9 files changed

+61
-22
lines changed

src/app/contract-addresses/page.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import {
1010
stages,
1111
stagesDisplayOrder,
1212
} from "../../data/stages";
13+
import OwnedLink from "../../components/OwnedLink";
1314

1415
# Contract Addresses
1516

1617
## Humanode
1718

18-
See the chain details at [Chains](https://link.humanode.io/docs/chains).
19+
See the chain details at <OwnedLink link="chains">Chains</OwnedLink>.
1920

2021
<Tabs
2122
storageKey="stage"
@@ -33,7 +34,7 @@ See the chain details at [Chains](https://link.humanode.io/docs/chains).
3334
</Tabs>
3435

3536
You can find smart contract descriptions
36-
at [Biomapper SDK docs](https://link.humanode.io/docs/biomapper-sdk).
37+
at <OwnedLink link="biomapperSdkDocs">Biomapper SDK docs</OwnedLink>.
3738

3839
## Bridged Chains
3940

src/app/integration/_meta.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import type { MetaRecord } from "nextra";
2+
import links from "../../data/links";
23

34
export default {
45
"general-information": "General Information",
5-
interfaces: {
6-
title: "Solidity API",
7-
href: "https://link.humanode.io/docs/biomapper-sdk",
8-
},
6+
interfaces: { title: "Solidity API", href: links.biomapperSdkDocs },
97
} as const satisfies MetaRecord;

src/app/integration/general-information/page.mdx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ import { Callout } from "nextra/components";
66
import Embed from "../../../components/Embed";
77
import { VscGithub } from "react-icons/vsc";
88
import { AiFillBook } from "react-icons/ai";
9+
import OwnedLink from "../../../components/OwnedLink";
10+
import links from "../../../data/links";
911

1012
# General Information
1113

1214
Here we outline the general guidance on how to integrate you dapp with
1315
Humanode Biomapper.
1416

1517
<Callout type="info">
16-
__TLDR__: just use the [Solidity ABI][interfaces].
18+
__TLDR__: just use the{" "}
19+
<OwnedLink link="biomapperSdkDocs">Solidity ABI</OwnedLink>.
1720
</Callout>
1821

19-
[interfaces]: https://link.humanode.io/docs/biomapper-sdk
20-
2122
## About Humanode Biomapper SDK
2223

2324
Humanode Biomapper SDK provides interfaces and useful utilities
@@ -47,25 +48,21 @@ The automatically generated documentation on the SDK components:
4748

4849
<Embed
4950
title="Solidity API"
50-
href="https://link.humanode.io/docs/biomapper-sdk"
51+
href={links.biomapperSdkDocs}
5152
icon={<AiFillBook />}
5253
/>
5354

5455
## Examples
5556

5657
See simple usage instructions at the Biomapper SDK repo here:
5758

58-
<Embed
59-
title="Usage"
60-
href="https://github.com/humanode-network/biomapper-sdk/tree/master/usage"
61-
icon={<VscGithub />}
62-
/>
59+
<Embed title="Usage" href={links.biomapperSdkRepoUsage} icon={<VscGithub />} />
6360

6461
and the more complete use cases demonstration here:
6562

6663
<Embed
6764
title="Examples"
68-
href="https://github.com/humanode-network/biomapper-sdk/tree/master/examples"
65+
href={links.biomapperSdkRepoExamples}
6966
icon={<VscGithub />}
7067
/>
7168

@@ -75,6 +72,6 @@ See the full Biomapper SDK source code at our Github:
7572

7673
<Embed
7774
title="Biomapper SDK"
78-
href="https://github.com/humanode-network/biomapper-sdk"
75+
href={links.biomapperSdkRepo}
7976
icon={<VscGithub />}
8077
/>

src/app/layout.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Image from "next/image";
77
import FaviconImage from "../assets/favicon.png";
88
import LogoImage from "../assets/logo.png";
99
import { Metadata } from "next";
10+
import links from "../data/links";
1011

1112
const logo = (
1213
<div
@@ -32,8 +33,8 @@ export const metadata: Metadata = {
3233
const navbar = (
3334
<Navbar
3435
logo={logo}
35-
projectLink="https://github.com/humanode-network/biomapper-docs"
36-
chatLink="https://link.humanode.io/chat"
36+
projectLink={links.biomapperDocsRepo}
37+
chatLink={links.chat}
3738
/>
3839
);
3940
const footer = <Footer>Humanode Biomapper Documentation</Footer>;
@@ -55,7 +56,7 @@ export default async function RootLayout({ children }) {
5556
<Layout
5657
navbar={navbar}
5758
pageMap={await getPageMap()}
58-
docsRepositoryBase="https://github.com/humanode-network/biomapper-docs/tree/master"
59+
docsRepositoryBase={links.biomapperDocsRepoMaster}
5960
footer={footer}
6061
>
6162
{children}

src/app/page.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title: Humanode Biomapper Docs
44

55
import Banner from "../components/Banner";
66
import { Cards } from "nextra/components";
7+
import links from "../data/links";
78

89
<Banner />
910

@@ -35,7 +36,7 @@ Integration instructions.
3536
/>
3637
<Cards.Card
3738
title="Solidity API"
38-
href="https://link.humanode.io/docs/biomapper-sdk"
39+
href={links.biomapperSdkDocs}
3940
target="_blank"
4041
/>
4142
</Cards>

src/app/showcase/page.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: A showcase of integartions with Humanode Biomapper.
44

55
import { Callout } from "nextra/components";
66
import Embed from "../../components/Embed";
7+
import links from "../../data/links";
78

89
# Integration Showcases
910

@@ -20,4 +21,4 @@ non-linear Liqudity Pool staking to the users.
2021
The non-liner aspect is only possible because the Humanode Biomapper relibaly
2122
protects our users from the Sybil-attacks.
2223

23-
<Embed title="Humanode Biostaker" href="https://mainnet.biostaker.hmnd.app" />
24+
<Embed title="Humanode Biostaker" href={links.biostakerMainnet} />

src/components/OwnedLink.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { PropsWithChildren } from "react";
2+
import links from "../data/links";
3+
import { A } from "./mdx";
4+
5+
type OwnedLinkProps = { link: keyof typeof links };
6+
const OwnedLink: React.FC<PropsWithChildren<OwnedLinkProps>> = ({
7+
children,
8+
link,
9+
}) => <A href={links[link]}>{children}</A>;
10+
11+
export default OwnedLink;

src/components/mdx.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ import { useMDXComponents } from "../mdx-components";
33
const components = useMDXComponents();
44

55
export const P = components.p;
6+
7+
export const A = components.a;

src/data/links.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const biomapperSdkDocs = "https://link.humanode.io/docs/biomapper-sdk";
2+
const biomapperSdkRepo = "https://github.com/humanode-network/biomapper-sdk";
3+
const biomapperSdkRepoUsage =
4+
"https://github.com/humanode-network/biomapper-sdk/tree/master/usage";
5+
const biomapperSdkRepoExamples =
6+
"https://github.com/humanode-network/biomapper-sdk/tree/master/examples";
7+
8+
const biostakerMainnet = "https://mainnet.biostaker.hmnd.app";
9+
const biomapperDocsRepo = "https://github.com/humanode-network/biomapper-docs";
10+
const biomapperDocsRepoMaster =
11+
"https://github.com/humanode-network/biomapper-docs/tree/master";
12+
const chat = "https://link.humanode.io/chat";
13+
const chains = "https://link.humanode.io/docs/chains";
14+
15+
const links = {
16+
chat,
17+
chains,
18+
biostakerMainnet,
19+
biomapperDocsRepo,
20+
biomapperDocsRepoMaster,
21+
biomapperSdkDocs,
22+
biomapperSdkRepo,
23+
biomapperSdkRepoUsage,
24+
biomapperSdkRepoExamples,
25+
} as const;
26+
27+
export default links;

0 commit comments

Comments
 (0)