Lesson: Create a Simple Webpage and Add It to IPFS
Last updated
Was this helpful?
Last updated
Was this helpful?
This lesson shows you how to create a simple webpage and add it to IPFS. Once you are able to do this you can make your webpages as beautiful or complex as you would like, and add them to IPFS using the same basic commands.
To do the steps in this lesson you must:
on your local machine
After doing this Lesson you will be able to
Create a simple webpage and add it to IPFS
If the IPFS daemon is not running already, then start the daemon now
Create a new webpage directory in your user's home directory.
Download this nice kitten image using ipfs:
Using a text editor, create a file called index.html
and copy/paste the following content:
Save index.html
in the simple-webpage
directory and close the text editor. If you like, you may open index.html
in the browser to see the webpage.
This simple webpage only has 2 files, index.html
and cat.jpg
. Now you will add the simple-webpage
directory to IPFS:
You should see output like the following:
Notice that you used the command ipfs add
with the -r
option to tell IPFS to recursively add the contents of the directory.
You can work on a webpage locally and then add it to IPFS. When you add your webpage directory content to IPFS, you use ipfs add
with the -r
option to recursively add all of the files within the directory to IPFS.
Proceed to the next lesson to learn how to