yingziwu / yingziwu.github.io

My bloger.
https://blog.bgme.me/
7 stars 1 forks source link

添加Disqus评论系统 - 影子屋 #44

Open yingziwu opened 5 years ago

yingziwu commented 5 years ago

https://blog.bgme.me//posts/add-disqus/

向博客添加Disqus评论系统的过程

VincentTam commented 5 years ago

Hi, this is the maintainer of @staticmanlab, a public GitLab instance of Staicman. Here's some shortcomings of the commenting systems mentioned above.

  1. Disqus is difficult to access for non programmers in the PRC, as reported in https://github.com/Huxpro/huxpro.github.io/issues/258#issuecomment-430842480.
  2. Gitment, Gitalk and Utterance support only GitHub, and they require user login before commenting. This can scare away many non programmers from leaving a comment to your posts. Besides, comments are part of the site's static content, not a software package problem. As a result, using GtiHub issues for comment storage is wrong in principle and bad in terms of SEO.
  3. Commento is not free as in free beer. For a personal blog with small traffic, you might find a monthly fee of $5 too expensive.
  4. Disqus and Isso contain a 3rd-party script to be loaded during page rendering. The code block for loading each of them shows that the static comments are not rendered as static HTML code. This hinders search engines from grabbing the comments, which are part of the site's content. As a result, that leads to suboptimal SEO.

You may avoid these problems by switching to Staticman, which makes use of GitHub/GitLab Pull/Merge Requests instead of issues. Under Staticman's model, static comments are YML/JSON files stored in the remote GitHub/GitLab repo (usually under data/comments, configurable through the path parameter in root-level staticman.yml), and through a static blog generator (Jekyll/Hugo/etc), the stored data are rendered as part of the content. This gives a total ownership of a static site's comments.

yingziwu commented 5 years ago

@VincentTam Thanks for your advice. After reading the document of Staicman, Staicman seems to only support Jekyll. But my blog is based on Nikola, so I can't use Staicman. Thank you any way.

VincentTam commented 5 years ago

@VincentTam Thanks for your advice. After reading the document of Staicman, Staicman seems to only support Jekyll. But my blog is based on Nikola, so I can't use Staicman. Thank you any way.

In fact, Staticman is just a tool for pushing HTML form data into GitHub/GitLab repo, and it doesn't care whether there's a static blog generator or not. See the author's comment at https://github.com/eduardoboucas/staticman/issues/264#issuecomment-460446511. As long as you own a GitHub/GitLab repo, you can use Staticman. You may see the barebone example https://gitlab.com/ntsim/test-staticman. (require GitLab login)

I had missed my list of Staticman demo pages on Framagit in my last comment. It contains a variety of Hugo and Jekyll themes.

math in comments
Figure: Math display in static comments on my demo Beautifhul Hugo + Staticman site