Open VincentTam opened 5 years ago
Hi @VincentTam, thanks, great work! I really like that you included a guide to test pout this branch as well, I think this will be really helpful for people who are looking to put in a comments block in their blog 👍
Go to Settings → Collaborators and add @staticmanlab as a collaborator.
N.B. On GitLab, the procedure is similar, but the next step can be omitted.
Open the following link so that @staticmanlab can accept your invitation.
https://staticman3.herokuapp.com/v3/github/connect/{username}/{repo-name}
N.B. It's reported that the public API instance https://api.staticman.net in eduardoboucas/staticman#227.
Edit config.toml
. Change master
to gh-pages
if your project page is hosted on the gh-pages
branch. Replace github
with gitlab
if your site is hosted on GitLab.
[Params.staticman] api = "https://staticman3.herokuapp.com/v3/entry/github/{username}/{repo-name}/master/comments"
#sitekey = # "6LeGeTgUAAAAAAqVrfTwox1kJQFdWl-mLzKasV0v"
#secret = # "hsGjWtWHR4HK4pT7cUsWTArJdZDxxE2pkdg/ArwCguqYQrhuubjj3RS9C5qa8xu4cx/Y9EwHwAMEeXPCZbLR9eW1K9LshissvNcYFfC/b8KKb4deH4V1+oqJEk/JcoK6jp6Rr2nZV4rjDP9M7nunC3WR5UGwMIYb8kKhur9pAic="
The settings for reCAPTCHA is optional. Encrypt your site secret with
Edit staticman.yml
so that the branch
matches the branch on which your site is hosted, and that the reCAPTCHA parameters match those in your config.
comments: allowedFields: ["name", "email", "website", "comment", "replyThread", "replyName", "replyID"] branch : "master" reCaptcha: enabled: false siteKey: # "6LeGeTgUAAAAAAqVrfTwox1kJQFdWl-mLzKasV0v" secret: # "hsGjWtWHR4HK4pT7cUsWTArJdZDxxE2pkdg/ArwCguqYQrhuubjj3RS9C5qa8xu4cx/Y9EwHwAMEeXPCZbLR9eW1K9LshissvNcYFfC/b8KKb4deH4V1+oqJEk/JcoK6jp6Rr2nZV4rjDP9M7nunC3WR5UGwMIYb8kKhur9pAic="
Resolves #3 and #8. This is basically a minimised port of Beautiful Hugo's native Staticman support. I'm not expert in CSS, so I'll leave the that for any interested user(s).
Demo site on GitLab
Staticman now supports GitLab at https://vincenttam.gitlab.io/er-demo
Quick guide to test this pull request
If you're using a theme as a Git submodule (as recommended in Hugo's official tutorial), you may create a new (local/GitLab/etc) (private) repo for this theme and run these commands to get this PR merged against a testing branch
staticman
in the private repo. I denote the URL of this repo as theupstream
.