Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[Optional feature]: Unfinished Staticman Nested Comment Support #119
Provide a free commenting service.
Hugo's built-in Disqus has no Markdown support. Staticman is open-source and transmits HTML form data as YML files to be merged in GitHub/GitLab repos. Despite its MIT license, the project had been bundled with GitHub for years. Thanks to Nicholas Tsim's PR, Staticman now supports GitLab.
To add Staticman, I've combined Minimal Mistakes and Beautiful Hugo's code so as to avoid breaking the original modals. I am not good at CSS at the moment, so the visual layout will be strange. It took me hours to understand the role of
Quick guide to test this PR
I assume the user has installed his/her Hugo theme(s) as a Git submodule.
$ git remote -v upstream https://github.com/vickylai/hugo-theme-introduction.git (fetch) upstream https://github.com/vickylai/hugo-theme-introduction.git (push) ... # other remote omitted $ git checkout -b pr119 # test on a new branch pr119 $ git fetch upstream pull/119/head # git pull will be rejected $ git merge FETCH_HEAD # manually merge the this PR against branch pr119 $ cd <your-blog> ... # edit your .gitmodules with url="<repo-containing-pr119>" and branch = "pr119" $ git submodule sync # inform Git the changes in .gitmodules $ git submodule update --remote --recursive # switch to the HEAD of your cloned repo for the theme
On the recent Staticman's public API bottleneck
Look back at what I've written, I believe that a self-review would help others.
I would appreciate any thoughts and code changes.
@VincentTam First of all: Thank you very much for the time and effort you put into this! The code you wrote it very elegant and fits well into hugo.
But I'm not sure if this is something I want to add to this theme. The theme is about setting up a simple and minimalistic personal site. Blogging is just a site feature of this theme. I assume most people just want to set up there site and don't care about comments.
@VincentTam Thoughts on this? Out of interests: Why did you put work into this theme and not any other?
@vickylai Would love to hear your thoughts on this!
Thank you for your reply despite my unfinished work. Since I'm not a developer, I publish it here for interested users.
This PR aims at providing comment support alternative to existing Disqus support. For Disqus vs Staticman, you may google for the rationale of preferring the later. (I'm replying on mobile.)
Whether comment is important is subjective. A theme designer may (or may not) offer the freedom for its users to enable this feature. With Staticman's config parameters missing or blank (default), such features will be disabled.
Looking back, my code isn't the best. I've messed up the code for the reply target in each comment reply. Please see the last point for details.
I did integrate Staticman into other templates. You may consult
IMHO, interactions with readers are beneficial to site owners, who often get great ideas from readers. Moreover, having static comments (with Gravatar of other users) is great in terms of SEO because search engines view this as the activities of the page.
I’d leave this one to the community to decide, if anyone wishes to weigh in. Introduction is meant to be a minimalist personal site, but I’m not opposed to the addition of comment functionality, as long as it is clearly optional. Especially with Staticman over Disqus.
I would like to be able to take a look at the styling within the next couple weeks. If anyone else wants to give it a go in the meantime, please do!