Staticman Script in Pure JS

Staticman without jQuery

The official Staticman script sample depends on jQuery. I have been using jQuery in my Staticman script for nested comments for more than six months. Recently, in the new release of Hugo Swift Theme, in which I’m a collaborator, one has removed all jQuery methods at commit f137efa4. Here’s the structure of the script: auxiliary functions like elem, elems, pushClass, deleteClass, etc. A self-executing function comments() some necessary local variables handleForm() consisting merely of an event listener handling form submission. [Read More]

Staticman With Introduction Theme

Goal To port Huginn’s Staticman integration to Introduction. Difficulties I’ve used some class names from Minimal Mistakes since the modals in the original code clashes with Introduction’s mobile responsive card display for projects. If I had know the practice of prepending a CSS class to avoid overiding the CSS properties of other components of a web site, I wouldn’t have mixed this Jekyll theme with my template for nested comments. [Read More]

More Static Nested Comments

Background I’ve made nested comment support for Beautiful Hugo, which I’ve ported to other Hugo themes like Introduction, Hyde-hyde, etc. Problem I Some of those Hugo themes that I worked with did show the HTML form, but the CSS styles were gone on the GitLab Pages. Reason I This is due to the lack of resources/_gen/ in the indexed repo for themes making use of assets/. Solution I Check that you have the required prerequisites. [Read More]

Huginn Theme With Staticman

Goal To provide Staticman support to the Hugo theme Huginn. Motivation A Framagit user tried using the public GitLab instance but failed. Finally, he removed Staticman from his site and his Hugo theme. If I had been notified, I would have explained that that was due to the constraint of gitlabBaseUrl, which could only take one GitLab instance. In response to demand for Staticman from Framagit users, I set up another GitLab instance of Staticman API and forked some Hugo/Jekyll repo under the project page Staticman et GitLab Pages. [Read More]

Replacing Deprecated Hugo Syntax in Blog Theme

Fixing Beautiful Hugo issue #261

Problem Since the recent Hugo upgrade to v0.55.3, the following messages popped up after each local site regeneration with hugo server. WARN 2019/04/24 18:07:00 Page's .URL is deprecated and will be removed in a futu re release. Use .Permalink or .RelPermalink. If what you want is the front matte r URL value, use .Params.url. WARN 2019/04/24 18:07:00 Page's .Hugo is deprecated and will be removed in a fut ure release. Use the global hugo function. [Read More]

Staticman Failure on Tsalikis' Site

Use Alternative Staticman API server

After reading Hugo Comments with Staticman on Kostas Tsalikis’ web site, I tried to leave the following comment. As far as I know, Staticman can be used only with GitHub, since it works as a GitHub bot. Obviously, not all static sites are saved in GitHub, and this may be a showstopper for someone using another service. Thanks to eduardoboucas/staticman#219, Staticman now supports GitLab. You may view my demo Hugo site on Framagit at https://staticman-gitlab-pages. [Read More]

Staticman Repo Setup Errors

Common Staticman Config Erorrs in Git repos

Background Idem to Staticman on Framagit. Besides, the build time for my Staticman + Beautiful Hugo demo on Framagit is half of that for the same project on GitLab.com. Problem After the setup, it’s possible that the theme shows “Sorry! There’s an error during submission.” To get an insight into this error, one has to open Web Developer Tools → Network and select the row corresponding to the POST request sent to the Staticman API. [Read More]

Staticman's Encryption Mechanism

Verify encrypted content

Background Staticman’s documentation gives a link to the public key for the public Staticman instance. I’ve set up my own Staticman instance for testing Staticman’s native GitLab support. It’s a coincidence that the public Staticman instance has been hitting it’s API limit, as reported in Staticman issue 227. To help others, I’ve published the URL of my own Staticman instance, which is associated with the GitHub/GitLab user staticmanlab. As Node.js’s RSA library has been used in Staticman, I have the responsibility to publish the public RSA key for my Staticman instance. [Read More]

Staticman on Framagit

It’s a pity that some GitLab users have removed Staticman from their repo. I saw demand for Staticman from Framagit users. Therefore, after two days of testing, another API instance for Framagit has been created at https://staticman-frama.herokuapp.com. (Edit: typo edited, please see my comment below.) The default GitLab base URL is set to “https://gitlab.com”. To provide Staticman support for a self-hosted GitLab service, another Staticman API server has to be set up. [Read More]

Staticman Invitation is Case Sensitive

A recent invitation error under Staticman v3

HTML and URL links are case insensitive. For example, GOOGLE.COM and google.com give the same address. As a result, after creating my fork of Beautiful Jekyll, I invited @staticmanlab to join my GitHub repo by firing the URL https://staticman3.herokuapp.com/v3/connect/github/vincenttam/beautiful-jekyll but I got Failed Staticman invitation The case for GitHub user name doens't match Successful Staticman invitation The case for GitHub user name match After matching vincenttam with the case of my user name displayed in the link for each of GitHub repos, [Read More]