Skip to content

Commit

Permalink
Update link checker and fix all broken links (#596)
Browse files Browse the repository at this point in the history
* Fix all links in en section

* Add link checker with bad link

* pnpm fmt

* Update link check action

* Remove duplicate output param

* Remove bad link

* Document the link check command

* Add TODO for GitHub auth

* Remove TODO
  • Loading branch information
jmintuitive authored Sep 13, 2024
1 parent dda365a commit 449f6c8
Show file tree
Hide file tree
Showing 38 changed files with 352 additions and 938 deletions.
54 changes: 45 additions & 9 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Links
name: Link Check

on:
pull_request:
Expand All @@ -10,12 +10,48 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Run Lychee Link Checker
uses: lycheeverse/lychee-action@v1
with:
args: --base . --verbose --no-progress './apps/nextra/**/*.mdx' './apps/nextra/**/*.html' --exclude 'http://localhost*' --exclude 'https://localhost*'
format: markdown
output: lychee/out.md
- name: Run Lychee Link Checker
uses: lycheeverse/lychee-action@v1
with:
# These args ensure that all relevant links are checked, without flaky failures.
#
# 1. The --remap helps resolve links which don't list their file extension since all relevant files are .mdx.
# It also accounts for headings in relative links. Ex. [abc](./file#header) -> .../file.mdx#header
# 2. TODO: When the /zh/ sections are all translated, please remove "--exclude '.*/zh/.*".
# This is a temporary measure since not all pages have been translated yet, but the links are still there.
# 3. --exclude '^(file:|[./]).*\.html$' - This section of exclusions avoids file paths for resources which are
# not actually relative links. They work at runtime by accessing the 'public' folder.
# 4. Other exclusions avoid flaky failures (from slow sites) or acceptable failures (from fake urls).
# 5. --accept '403,401,429' - These errors generally mean the link works, but our tool can't access them.
# 6. --retry-wait-time - The time in seconds to wait before trying again if we get a 429 error.
# 7. --max-retries - How many times we're willing to try again before failing the link.
# 8. TODO: In the future, if we want to avoid GitHub rate limits, we should add a GitHub token to authenticate
# with. This would change the rate limit from 60 requests/hour to 5,000 requests/hour.
args: >
--remap '(^[^.#]+)(\.?)(#.*)?$ $1.mdx$3'
--exclude '.*/zh/.*'
--exclude '^(file:|[./]).*\.html$'
--exclude '^(file:|[./]).*\.png$'
--exclude '^(file:|[./]).*\.jpg$'
--exclude '^(file:|[./]).*\.jpeg$'
--exclude '^(file:|[./]).*\.svg$'
--exclude '^(file:|[./]).*\.mp4$'
--exclude '^(file:|[./]).*\.gif$'
--exclude 'aptos-api-spec'
--exclude '^(https?:\/\/localhost|https?:\/\/127\.0\.0\.1).*'
--exclude '.*your-app.*'
--exclude '^https://packages\.ubuntu\.com/.*'
--exclude '^https://app\.spaceandtime\.ai/.*'
--exclude '.*%7BmenuImage%7D.*'
--exclude '.*imageUrl.*'
--accept '403,401,429'
--retry-wait-time 1
--max-retries 2
--base .
--verbose
--no-progress './apps/nextra/**/*.mdx' './apps/nextra/**/*.html'
format: markdown
fail: true
output: lychee/out.md
2 changes: 1 addition & 1 deletion apps/nextra/pages/en/build/apis/data-providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This type of data is often used for analytics since it allows for aggregations.

## Review of data endpoints

Hitting the full node directly will give the latest data (will be missing historical unless it's an archival full node) using [REST API](/apis#aptos-fullnode)
Hitting the full node directly will give the latest data (will be missing historical unless it's an archival full node) using [REST API](../apis.mdx#aptos-fullnode)

Indexer layer on top of this will provide a [GRPC transaction stream](../indexer/txn-stream/aptos-hosted-txn-stream)

Expand Down
2 changes: 1 addition & 1 deletion apps/nextra/pages/en/build/cli/running-a-local-network.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ To debug this, try the below fixes:
As you can see from the example output in step 4, once the local network is running, you have access to the following services:
- [Node API](../../network/nodes/aptos-api-spec.mdx): This is a REST API that runs directly on the node. It enables core write functionality such as transaction submission and a limited set of read functionality, such as reading account resources or Move module information.
- [Indexer API](../indexer/api.mdx): This is a [GraphQL](https://graphql.org/) API that provides rich read access to indexed blockchain data. If you click on the URL for the Indexer API above, by default [http://127.0.0.1:8090](http://127.0.0.1:8090/), it will open the Hasura Console, a web UI that will help you query the Indexer GraphQL API.
- [Indexer API](../indexer/aptos-hosted.mdx): This is a [GraphQL](https://graphql.org/) API that provides rich read access to indexed blockchain data. If you click on the URL for the Indexer API above, by default [http://127.0.0.1:8090](http://127.0.0.1:8090/), it will open the Hasura Console, a web UI that will help you query the Indexer GraphQL API.
- [Transaction Stream Service](../indexer/txn-stream.mdx): This is a gRPC stream of transactions used by the Indexer API. This is only relevant to you if you are developing a [custom processor](../indexer/custom-processors.mdx).
- [Postgres](https://www.postgresql.org/): This is the database that the Indexer processors write to. The Indexer API reads from this database.
- [Faucet](../guides/system-integrators-guide.mdx#integrating-with-the-faucet): You can use this to fund accounts on your local network.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ The rest are optional fields to help customize your mint.
### Click "Create Collection"
When adding the folder, it submits the files to [Irys](https://irys.xyz/), a decentralized asset server, that will store your files.

During the upload process, you will need to sign two messages to approve file uploading to Irys. Additionally, you may need to fund an Irys node. Read more about the process [here](https://docs.irys.xyz/hands-on/tutorials/uploading-nfts).
During the upload process, you will need to sign two messages to approve file uploading to Irys. Additionally, you may need to fund an Irys node. Read more about the process [here](https://arweave-tools.irys.xyz/tutorials/nfts/uploading-nfts).

### Once you approve the transaction, you have successfully created a Collection on Aptos!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ The rest are optional fields to help customize your mint.
### Click "Create Asset"
When adding the image, it submits the file to [Irys](https://irys.xyz/), a decentralized asset server, that will store your files.

During the upload process, you will need to sign a message to approve file uploading to Irys. Additionally, you may need to fund an Irys node. Read more about the process [here](https://docs.irys.xyz/hands-on/tutorials/uploading-nfts).
During the upload process, you will need to sign a message to approve file uploading to Irys. Additionally, you may need to fund an Irys node. Read more about the process [here](https://arweave-tools.irys.xyz/tutorials/nfts/uploading-nfts).

### Once you approve the transaction, you have successfully created a fungible asset on Aptos!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Callout, FileTree, Steps } from 'nextra/components';

# Create Aptos Dapp Token Staking Dapp Template

The Token staking dapp template provides an end-to-end [Fungible Asset]((../../smart-contracts/digital-asset.mdx)) staking dapp.
The Token staking dapp template provides an end-to-end [Fungible Asset](../../smart-contracts/digital-asset.mdx) staking dapp.

With this dapp, you can:
1. Create an incetivize pool on Aptos.
Expand Down
2 changes: 1 addition & 1 deletion apps/nextra/pages/en/build/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ See the [Smart Contract](smart-contracts.mdx) section for more info
### Interactive guides

<Cards>
<Card href="https://learn.aptoslabs.com/guides">
<Card href="https://learn.aptoslabs.com/en/workshops">
<Card.Title linkType="external">Aptos Learn</Card.Title>
<Card.Description>Basic and advanced guides</Card.Description>
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Ethereum to Aptos Cheatsheet"

# Ethereum to Aptos Cheatsheet

To learn more about the differences and similarities see [Aptos Learn](https://learn.aptoslabs.com/en/tutorial/ethereum-to-aptos-guide/cheat-sheet)
To learn more about the differences and similarities see [Aptos Learn](https://learn.aptoslabs.com/en/tutorials/ethereum-to-aptos-guide/cheat-sheet?workshop=eth-to-aptos)

### High Level Overview

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Solana to Aptos Cheatsheet"

# Solana to Aptos Cheatsheet

To learn more about the differences and similarities see [Aptos Learn](https://learn.aptoslabs.com/en/tutorial/solana-to-aptos-guide/cheat-sheet)
To learn more about the differences and similarities see [Aptos Learn](https://learn.aptoslabs.com/en/tutorials/solana-to-aptos-guide/cheat-sheet?workshop=solana-to-aptos)

| | Solana | Aptos |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can find an example app demonstrating basic Keyless integration with Google

The first step is to setup the configuration with your IdP(s).

[Follow the intructions here](oidc-support.md)
[Follow the intructions here](oidc-support.mdx)

### Step 2. Install the Aptos TypeScript SDK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Keyless Introduction"

# Introduction

Keyless accounts represent a pivotal advancement within the Aptos ecosystem, revolutionizing the way users onboard and interact with decentralized applications (dApps). Aptos Keyless allows users to gain ownership of an Aptos blockchain account from their existing OpenID Connect (OIDC) account(s) (e.g., Sign in with Google; Sign in with Apple), rather than from a traditional secret key or mnemonic. In a nutshell, with Aptos Keyless, a user’s blockchain account is their OIDC account. Over time, Keyless will evolve to support many IdPs who support the OIDC standard, but we will begin with support for the providers listed [here](oidc-support.md).
Keyless accounts represent a pivotal advancement within the Aptos ecosystem, revolutionizing the way users onboard and interact with decentralized applications (dApps). Aptos Keyless allows users to gain ownership of an Aptos blockchain account from their existing OpenID Connect (OIDC) account(s) (e.g., Sign in with Google; Sign in with Apple), rather than from a traditional secret key or mnemonic. In a nutshell, with Aptos Keyless, a user’s blockchain account is their OIDC account. Over time, Keyless will evolve to support many IdPs who support the OIDC standard, but we will begin with support for the providers listed [here](oidc-support.mdx).

At the core of the keyless accounts paradigm lies a deep understanding of user experience and security challenges prevalent in traditional blockchain systems. Managing private keys, the cornerstone of user identity and asset ownership, often proves cumbersome and error-prone for users, particularly those lacking technical expertise. Keyless accounts offer an elegant solution by obviating the need for users to grapple with the intricacies of private key management. Instead, users authenticate themselves through access to common social sign in options like Google, Apple, and many more. With this new system comes some important tradeoffs to understand on behalf of your users before implementing Keyless in your application. The following pages will expand on the benefits of Keyless accounts, how to integrate, the system architecture, and FAQs. For a more verbose and technical dive into Keyless accounts, please see [AIP-61-Keyless Accounts](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-61.md).

Expand Down
2 changes: 1 addition & 1 deletion apps/nextra/pages/en/build/guides/first-coin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ curl -sSL https://install.python-poetry.org | python3
poetry install
```

Run the Python [`your_coin`](https://github.com/aptos-labs/aptos-core/blob/main/ecosystem/python/sdk/examples/your_coin.py) example:
Run the Python [`your_coin`](https://github.com/aptos-labs/aptos-python-sdk/blob/main/examples/your_coin.py) example:

```bash filename="Terminal"
poetry run python -m examples.your_coin ~/aptos-core/aptos-move/move-examples/moon_coin
Expand Down
6 changes: 3 additions & 3 deletions apps/nextra/pages/en/build/guides/first-transaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ curl -sSL https://install.python-poetry.org | python3
poetry install
```

Run the [`transfer-coin`](https://github.com/aptos-labs/aptos-python-sdk/examples/transfer_coin.py) example:
Run the [`transfer-coin`](https://github.com/aptos-labs/aptos-python-sdk/blob/main/examples/transfer_coin.py) example:

```bash filename="Terminal"
poetry run python -m examples.transfer_coin
Expand Down Expand Up @@ -220,7 +220,7 @@ See the TypeScript [`transfer_coin`](https://github.com/aptos-labs/aptos-ts-sdk/
<Tabs.Tab>

<Callout type="info">
See the Python [`transfer_coin`](https://github.com/aptos-python-sdk/examples/transfer_coin.py) for the complete code as you follow the below steps.
See the Python [`transfer_coin`](https://github.com/aptos-labs/aptos-python-sdk/blob/main/examples/transfer_coin.py) for the complete code as you follow the below steps.
</Callout>
</Tabs.Tab>
<Tabs.Tab>
Expand Down Expand Up @@ -263,7 +263,7 @@ rest_client = RestClient(NODE_URL)
faucet_client = FaucetClient(FAUCET_URL, rest_client)
```

[`common.py`](https://github.com/aptos-labs/aptos-python-sdk/examples/common.py) initializes these values as follows:
[`common.py`](https://github.com/aptos-labs/aptos-python-sdk/blob/main/examples/common.py) initializes these values as follows:

```python filename="common.py"
NODE_URL = os.getenv("APTOS_NODE_URL", "https://api.devnet.aptoslabs.com/v1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ These are demonstrations of sponsored transactions:
- The TypeScript SDK
has [several examples](https://github.com/aptos-labs/aptos-ts-sdk/tree/main/examples/typescript-esm/sponsored_transactions)
- The Python SDK has an example
in [fee_payer_transfer_coin.py](https://github.com/aptos-labs/aptos-core/blob/main/ecosystem/python/sdk/examples/fee_payer_transfer_coin.py).
in [fee_payer_transfer_coin.py](https://github.com/aptos-labs/aptos-python-sdk/blob/main/examples/fee_payer_transfer_coin.py).
- The Rust SDK has a test case
in [the API tests](https://github.com/aptos-labs/aptos-core/blob/0a62e54e13bc5da604ceaf39efed5c012a292078/api/src/tests/transactions_test.rs#L255).
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ will output the location of the services.
* [REST API](https://api.mainnet.aptoslabs.com/v1)
* [REST API Spec](https://api.mainnet.aptoslabs.com/v1/spec#)
* [Indexer API](https://api.mainnet.aptoslabs.com/v1/graphql)
* [Faucet API](https://faucet.mainnet.aptoslabs.com)
* [Indexer GraphQL](https://cloud.hasura.io/public/graphiql?endpoint=https://api.mainnet.aptoslabs.com/v1/graphql)

### SDKs and tools
Expand Down Expand Up @@ -215,7 +214,7 @@ defined within any module. Here's an
example [Move script](https://github.com/aptos-labs/aptos-core/tree/main/aptos-move/move-examples/scripts/two_by_two_transfer)
that uses a MultiAgent transaction to extract funds from two accounts and
deposit them into two other accounts. This is
a [Python example](https://github.com/aptos-labs/aptos-core/blob/main/ecosystem/python/sdk/examples/transfer_two_by_two.py)
a [Python example](https://github.com/aptos-labs/aptos-python-sdk/blob/main/examples/transfer_two_by_two.py)
that uses the bytecode generated by compiling that script. Currently, there is
limited support for script payloads in TypeScript.

Expand Down Expand Up @@ -243,7 +242,7 @@ to [`/transactions/simulate`](https://api.devnet.aptoslabs.com/v1/spec#/operatio

Both
the [Typescript SDK](https://github.com/aptos-labs/aptos-ts-sdk/blob/main/src/api/transactionSubmission/simulate.ts)
and [Python SDK](https://github.com/aptos-labs/aptos-core/blob/main/ecosystem/python/sdk/examples/simulate_transfer_coin.py)
and [Python SDK](https://github.com/aptos-labs/aptos-python-sdk/blob/main/examples/simulate_transfer_coin.py)
support the simulation API. Note the output and gas used may change based upon
the state of the account. For gas estimations, we recommend that the maximum gas
amount be larger than the amount quoted by this API.
Expand Down
6 changes: 3 additions & 3 deletions apps/nextra/pages/en/build/guides/your-first-nft.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ curl -sSL https://install.python-poetry.org | python3
poetry install
```

Run the Python [`simple_aptos_token`](https://github.com/aptos-labs/aptos-python-sdk/examples/simple_aptos_token.py) example:
Run the Python [`simple_aptos_token`](https://github.com/aptos-labs/aptos-python-sdk/blob/main/examples/simple_aptos_token.py) example:

```bash filename="Terminal"
poetry run python -m examples.simple_aptos_token
Expand Down Expand Up @@ -236,7 +236,7 @@ Token owner: Alice
</Tabs.Tab>
<Tabs.Tab>
<Callout type="info">
See [`simple_aptos_token`](https://github.com/aptos-labs/aptos-python-sdk/examples/simple_aptos_token.py) for the complete code as you follow the below steps.
See [`simple_aptos_token`](https://github.com/aptos-labs/aptos-python-sdk/blob/main/examples/simple_aptos_token.py) for the complete code as you follow the below steps.
</Callout>
</Tabs.Tab>
</Tabs>
Expand Down Expand Up @@ -281,7 +281,7 @@ Using the API client we can create a `TokenClient` that we use for common token
token_client = AptosTokenClient(rest_client)
```

[`common.py`](https://github.com/aptos-labs/aptos-python-sdk/examples/common.py) initializes these values as follows:
[`common.py`](https://github.com/aptos-labs/aptos-python-sdk/blob/main/examples/common.py) initializes these values as follows:

```python filename="example.py"
NODE_URL = os.getenv("APTOS_NODE_URL", "https://api.devnet.aptoslabs.com/v1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const [balance] = await surfClient.view.balance({
- [Surf GitHub](https://github.com/ThalaLabs/surf)
- [A simple Next.js example demonstrating Surf](https://github.com/ThalaLabs/surf/tree/main/example)
- [An example of a fungible asset launchpad using Surf](https://github.com/aptos-labs/move-by-examples/tree/main/fungible-asset-launchpad): This example is part of the Solana to Aptos guide on Aptos Learn, you can try it [here](https://fungible-asset-launchpad.vercel.app/) and read the complete tutorial [here](https://learn.aptoslabs.com/example/solana-to-aptos-2/fa-launchpad/demo).
- [An example of a fungible asset launchpad using Surf](https://github.com/aptos-labs/move-by-examples/tree/main/fungible-asset-launchpad): This example is part of the Solana to Aptos guide on Aptos Learn, you can try it [here](https://fungible-asset-launchpad.vercel.app/) and read the complete tutorial [here](https://learn.aptoslabs.com/en/tutorials/aptogotchi-intermediate/fungible-assets?workshop=solana-to-aptos).
## Credits
Expand Down
1 change: 0 additions & 1 deletion apps/nextra/pages/en/build/smart-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ Here is a `hello_blockchain` example of move
- [Aptos Move by Example](https://move-developers-dao.gitbook.io/aptos-move-by-example)
- [Teach yourself Move on Aptos](https://github.com/econia-labs/teach-yourself-move).
- [Formal Verification, the Move Language, and the Move Prover](https://www.certik.com/resources/blog/2wSOZ3mC55AB6CYol6Q2rP-formal-verification-the-move-language-and-the-move-prover)
- [IMCODING Move Tutorials](https://www.imcoding.online/tutorials?tag=Aptos)
- [Pontem Move Playground](https://playground.pontem.network/)
- [Collection of nestable Move resources](https://github.com/taoheorg/taohe)

Expand Down
Loading

0 comments on commit 449f6c8

Please sign in to comment.