$ ipfs name publish <your site hash>
This may take a few minutes. We will see how to do this faster using DNSLink below.
You will see something link this after your website has been published using IPNS.
Published to QmdZZgjYoh9sQUonNyefkMyXhEMXFC2rGvhXsJAbAPsF55: /ipfs/QmQToNGFsGMkQe76mRirCvRykJSiRB1JPpRLumyMN7N67T
That will return your peerID(the bold text above) and the hash you are publishing to it. You can confirm by running:
$ ipfs name resolve <peerId>
This will also a few minutes. After this is executed, you will see something like this:
/ipfs/QmQToNGFsGMkQe76mRirCvRykJSiRB1JPpRLumyMN7N67T
or you can view https://gateway.ipfs.io/ipns/<peerID> (notice the directory is ipns not ipfs). This will also a few minutes.
After a few minutes, you will be able to see your website
这是一个快速教程,将教您怎么做
1.在IPFS上托管一个简单的静态网站
2.Add to IPFS
Next, you need to add the site to IPFS.
Publish to IPNS:
参考