Joomaen

Joomaen's xlog

Joomaen
tg_channel
jike

Planet Blog Settings

Add Comment Functionality#

Use Giscus to add a comment feature to Planet.

Create a public repository as required, install the Giscus App, fill in the repository name, and it will generate a code like the one below. Just add it to the end of the article, and Planet will render it automatically.

# Do not copy mine, just for reference, the Giscus website will generate its own
<script src="https://giscus.app/client.js"
        data-repo="username/repository-name"
        data-repo-id="R_kgDONv0EQg"
        data-category="Announcements"
        data-category-id="DIC_kwDONv0EQs4CmW3b"
        data-mapping="pathname"
        data-strict="0"
        data-reactions-enabled="1"
        data-emit-metadata="0"
        data-input-position="bottom"
        data-theme="preferred_color_scheme"
        data-lang="en"
        crossorigin="anonymous"
        async>
</script>

Modify Template Code to Add Google Analytics#

Log in to Google Analytics with a Google account to create an account, then create a property to get the Google Analytics tracking code, which will provide a string of code. Similar to this:

# Reference
<!-- Google tag (gtag.js) --> 
<script async src="https://www.googletagmanager.com/gtag/js?id=G-code"></script> 
<script> 
  window.dataLayer = window.dataLayer || []; 
  function gtag(){dataLayer.push(arguments);} 
  gtag('js', new Date()); 
  
  gtag('config', 'G-code'); 
</script>

Open the Tools - Template Browser in the top left menu of Planet, select the template you are using, and open the folder to view the HTML template file. Edit the templates/base.html file in the template, using VScode or other tools, to insert the obtained tracking code below the <head>, then click Tools - Reload Website to regenerate the static pages.

When configuring Google Analytics, you need to have a corresponding domain name, so it seems that accessing via a public gateway or local IPFS node cannot be tracked by GA. My Privacy page also has an introduction.


Domain Name#

Register a blockchain domain, .eth, .bit, or .sol can all bind to IPNS, and then access it through the corresponding public network.

I currently have a .bit domain, which can be accessed through the public node .bit.site after binding IPNS in the backend. It provides free IPFS PIN services for .bit domains, and after binding, it will store the static content in Planet, so you don't have to worry about not being able to access it when the computer is turned off.

Currently, I recommend the .sol domain, as .eth is too expensive, and .bit is not too expensive but requires annual payment, while .sol is permanent, with a one-time payment, based on the Solana chain, and I am preparing to get one.


IPFS Hosting#

I also use 4EVERLAND to host IPFS files. Go to the official website to connect your crypto wallet, and then deposit the equivalent of 1 dollar in the corresponding cryptocurrency to use the services it provides. You can host IPNS, IPFS, connect to GitHub repositories, etc. It also provides S3 object storage. Of course, I only used IPNS hosting. Copy the IPNS from Planet, create a new Hosting project in 4EVERLAND, select IPNS and fill it in. It provides 2 subdomains for access, and you can also bind your own domain. Remember to enable automatic redeployment of IPNS in the settings, so it will automatically sync every day at 18:00. If you need immediate synchronization, you can do it manually. I just use it as a PIN service and as a backup, so I let it sync automatically.
Screenshot 2025-01-28 22.24.31.png


Summary#

This series of operations has made the Planet static IPFS blog more reliable and easier to access, and it now has comment support. Of course, RSS is also supported; any gateway or domain can access /rss.xml to subscribe.

It seems that WordPress is not very necessary anymore.
I still use xLog and quite like it, but Planet is still the main one; it is truly fully localized and distributed storage.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.