Skip to content

Commit

Permalink
Merge pull request #260 from Developer-DAO/staging
Browse files Browse the repository at this point in the history
staging -> prod
  • Loading branch information
wolovim committed Jun 28, 2024
2 parents 27e42f1 + c940951 commit d502b5d
Showing 1 changed file with 45 additions and 21 deletions.
66 changes: 45 additions & 21 deletions apps/academy/src/pages/tracks/arweave-101/4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ Eleventy’s templating language.
To create the website, you have to create a new Node.js project and install Eleventy with the
following commands:

mkdir permablog && cd permablog
npm init -y
npm i -D arweave @11ty/eleventy @ardrive/turbo-sdk @ar.io/sdk
```bash
mkdir permablog && cd permablog
npm init -y
npm i -D arweave @11ty/eleventy @ardrive/turbo-sdk @ar.io/sdk
```

Create a `.eleventy.js` file to define a filter that drops the first slash. Eleventy will start all
permalinks with a slash, but websites on Arweave are nested under their transaction ID (TXID), so
Expand All @@ -104,11 +106,15 @@ URL generated by Eleventy to a relative URL that works on the Permaweb.

By default, an Eleventy permalink defined as `/your-post/` would point to this (non-existent) URL:

https://arweave.developerdao.com/your-post/
```
https://arweave.developerdao.com/your-post/
```

With the filter, it will point to this URL instead:

https://arweave.developerdao.com/some-transaction-id-9999/your-post/
```
https://arweave.developerdao.com/some-transaction-id-9999/your-post/
```

### Creating a Layout

Expand Down Expand Up @@ -222,7 +228,9 @@ Add new commands to your scripts in the `package.json` file to generate HTML fro

Execute the build script with this command:

npm run build
```bash
npm run build
```

The output should look like this:

Expand All @@ -242,7 +250,9 @@ After completing this command, you’ll find your rendered HTML files in the `di
If you want to check that everything with your website is working as you expect, run the following
command:

npm start
```bash
npm start
```

The `start` script builds your website and starts a development server on `http://localhost:8080/`,
where you can test your blog before deploying it.
Expand Down Expand Up @@ -283,7 +293,9 @@ fs.writeFileSync("key.json", JSON.stringify(wallet));

Then execute it with this command:

node scripts/create-wallet.mjs
```bash
node scripts/create-wallet.mjs
```

When the command is complete, you’ll have a `key.json` file in your project directory.

Expand Down Expand Up @@ -360,7 +372,9 @@ console.log(`https://arweave.developerdao.com/${result.id}`);

Uploading your files to Arweave is just one command away:

npm run deploy
```bash
npm run deploy
```

The output of this command should look like this:

Expand Down Expand Up @@ -390,7 +404,8 @@ Testing is quite simple; you just need to open the printed URL in your browser.
should work with all Arweave gateways. Figure 1 shows the blog in the browser.

![Figure 1: Permablog preview](/assets/tracks/arweave-101/4/figure-1.png)
Figure 1: Permablog preview

<div style={{ textAlign: "center" }}>*Figure 1: Permablog preview*</div>

You can try the blog I deployed with different gateways:

Expand Down Expand Up @@ -418,24 +433,30 @@ contrast to TXIDs, they are mutable, allowing UX closer to traditional websites.

Instead of the TXID URL that looks like this:

https://arweave.developerdao.com/some-transaction-id-9999/path/to/some/file.html
https://ar-io.dev/some-transaction-id-9999/path/to/some/file.html
```
https://arweave.developerdao.com/some-transaction-id-9999/path/to/some/file.html
https://ar-io.dev/some-transaction-id-9999/path/to/some/file.html
```

You can share an ArNS URL that looks like this:

https://arweave101.arweave.developerddao.com/path/to/some/file.html
https://arweave101.ar-io.dev/path/to/some/file.html
```
https://arweave101.arweave.developerddao.com/path/to/some/file.html
https://arweave101.ar-io.dev/path/to/some/file.html
```

When you upload a new release, you can simply point the ArNS name to the new TXID, and your users
will automatically see the latest version.

ArNS supports so-called under names, which are additional names prefixed with an underline to your
ArNS domain.

blog_arweave101.arweave.developerddao.com/path/to/file.html
test_arweave101.arweave.developerddao.com/path/to/file.html
first_test_arweave101.arweave.developerddao.com/path/to/file.html
second_test_arweave101.arweave.developerddao.com/path/to/file.html
```
blog_arweave101.arweave.developerddao.com/path/to/file.html
test_arweave101.arweave.developerddao.com/path/to/file.html
first_test_arweave101.arweave.developerddao.com/path/to/file.html
second_test_arweave101.arweave.developerddao.com/path/to/file.html
```

Arweave Name Tokens (ANTs) are NFTs that enable the management of ArNS names in a decentralized way.

Expand Down Expand Up @@ -469,7 +490,8 @@ your project directory into the "Arweave Transaction ID" field, to point your Ar
latest release right after the registration completes.

![Figure 2: Registering an ArNS name](/assets/tracks/arweave-101/4/figure-2.png)
Figure 2: Registering an ArNS name

<div style={{ textAlign: "center" }}>*Figure 2: Registering an ArNS name*</div>

### Testing Deployed Release With the ArNS Name

Expand All @@ -478,8 +500,10 @@ After changing the TXID and your ArNS name, you can access your blog via your ne
I created an example undername to illustrate the functionality. You can test them with different
Arweave gateways:

https://demo-blog_fllstck.arweave.developerdao.com/
https://demo-blog_fllstck.ar-io.dev/
```
https://demo-blog_fllstck.arweave.developerdao.com/
https://demo-blog_fllstck.ar-io.dev/
```

And that’s it!

Expand Down

0 comments on commit d502b5d

Please sign in to comment.