Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Optional feature]: 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!
I've recently revised the template code in another Hugo theme Huginn. The reasons are two-folded.
Since the Go template & JS code used for both themes were essentially the same at the beginning, an overall comparison
referenced this pull request
May 24, 2019
If you don't want to do that, you can still look over my changes in the new branch and see if there's anything you'd like to implement on your own.
@victoriadotdev Thanks for merging
At the bottom right corner of the screenshot, I can see that the relevant checkbox is checked. I'm going to contact GitHub support for that.
@victoriadrake Another update: Despite further discussions with GitHub Support staff, she couldn't find out the reason why you were unable to push to this PR. Since this PR's submission, the write permissions from maintainers have always been enabled. I tried asking if your recent change of user name had contributed to this error, by she was unable to verify this theory after some tests.
It seems that this push failure is due to past conflicts of translation files, in which your user name appeared at the bottom.
As a result, each translation file is modified on both sides at the end of the file, and this causes a merge conflict. As can be seen from the commit tree of the HEAD of this PR, I've merged your changes this week, so the conflicts have been resolved. Hope this solves your difficulties in committing against the head of this PR.
A self-review on the recent changes of this PR
As before, please feel free to change anything and/or leave a comment/question(s).