# Using Github Pages to Serve Voxel as HTML by Using Template

By [Web3dAppDevCamp](https://paragraph.com/@apecoder) · 2022-03-05

---

> **Author:** [qiwihui](https://github.com/qiwihui)

In this articles, we will show how to use Github pages to serve Voxel as HTML by using template. This HTML file will be used to mint our NFT.

In the previous article, we have upload the voxel file to Arweave with Permaweb Dropper. And we got the permanent link of the voxel file, for example `https://5ywn6daenz6poefpjkgs3c2vdgtzsk2vevam6aozkfzzzwrmgi.arweave.net/nFF3J4VB0BP9eHt35gdffGuwCXaHfXwtJl2K6u4GyA0`. Now Let's use Github pages to serve the voxel file as HTML.

0x01 Clone the repository
-------------------------

First, we can navigate to the [WeLightProject/voxel-viewer-page](https://github.com/WeLightProject/voxel-viewer-page) project. This is a template repository. We will use this template to create our own project.

![use-this-template](https://storage.googleapis.com/papyrus_images/0181cacd6ce7dbdff4a58c932a01885e13f0590805c19aae9ba98e24e3588616.png)

use-this-template

Click the `use this template` button, and you will see the following page. We need to fill the repository name and description. Then just click the `Create repository from template` button. Then the repository will be created in a few seconds.

![repository-info](https://storage.googleapis.com/papyrus_images/d572168bca3f6cc95c96a767c3b35ee33ee24ffe6a0735c2089f30fc3bb03a87.png)

repository-info

0x02 Replace the voxel link and commit
--------------------------------------

Second, we need to clone the repository. We can click the "Clone" button. Then wen can copy the link of the repository. For example, `https://github.com/qiwihui/MyDeerVoxel.git`.

![clone](https://storage.googleapis.com/papyrus_images/9f59114531497636d89220b164c61fbf8334ad1c04916026d2ab5be45dff7eba.png)

clone

Then we can open a terminal and run the following command to clone the repository.

    git clone https://github.com/qiwihui/MyDeerVoxel.git
    cd MyDeerVoxel
    

We need to replace the voxel link in the `handler.js` file. We can open the `handler.js` file in your IDE, and in the 19th line, we need to replace the link in `src` tag to the permanent link of the voxel file, which is `https://5ywn6daenz6poefpjkgs3c2vdgtzsk2vevam6aozkfzzzwrmgi.arweave.net/nFF3J4VB0BP9eHt35gdffGuwCXaHfXwtJl2K6u4GyA0`.

![replace-link](https://storage.googleapis.com/papyrus_images/1ce5f56db3d81cf536525da07e61dd016314482e666454e88e270a878fe121ab.png)

replace-link

Then we need to commit the changes and push it to Github. We can run the following command to commit the changes.

    git add .
    git commit -m "Add voxel file link"
    git push origin master
    

0x03 Deploy to Github Pages
---------------------------

Finally, we need to setup the Github pages. We navigate to repository url and click `Settings`. Then we can click the `Pages` tab. We should choose the `main` branch. And then click `Save`.

![choose-branch](https://storage.googleapis.com/papyrus_images/5ab7801a9ac03593607ff08f3e3343b83f6f4f6b80a8565ea7f4e7add050a83a.png)

choose-branch

The Github Pages will deploy your project automatically and you can see the website link when it is ready. For example, `https://qiwihui.github.io/MyDeerVoxel`.

![view-the-link](https://storage.googleapis.com/papyrus_images/eb83dc48881c23bdcf35b3636ca026581d79cd5f2d536fe887f13b15433a610e.png)

view-the-link

We can now open the website in your browser. The website will show the voxel file.

![website-ready](https://storage.googleapis.com/papyrus_images/6be90993179021210f854109445c10c15b8eaa126a5fa11db8bc865c0770d772.png)

website-ready

Cool! Now we can mint our NFT using deployed url.

we need three items:

![Index of dApp](https://storage.googleapis.com/papyrus_images/472d608dd5df38ee8a5d1e75e2549958db17613fcbadbd7683c6b317c93a1b00.png)

Index of dApp

*   **Voxel URI** -- Uploaded by Permaweb Dropper
    
    [https://arweave.net/7izfDARufPcQr0qNLYtVGaeZK1UlQM8B\_2VFznNosMs](https://arweave.net/7izfDARufPcQr0qNLYtVGaeZK1UlQM8B_2VFznNosMs)
    
*   Github Pages URL -- You just generated
    
*   Commit Hash -- to make sure the github pages is not changed after NFT minted.
    

![How to find latest commit hash](https://storage.googleapis.com/papyrus_images/2113a1b6fa3ab4c492f12d65877c3632bba72a387cd14f8be389c345d413f7c8.png)

How to find latest commit hash

![How to find latest commit hash](https://storage.googleapis.com/papyrus_images/b4e335b66a3220fbc3c3d41f536e384978eb731967fef830976f227521ca794a.png)

How to find latest commit hash

---

*Originally published on [Web3dAppDevCamp](https://paragraph.com/@apecoder/using-github-pages-to-serve-voxel-as-html-by-using-template)*
