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.

I tried applying for OpenShift, but it’s been reported on Reddit that it takes about 10–20 days to get started. Amazon requires verification by credit card. I couldn’t deploy Staticman using Zeit Now’s Node.js server builder. Finally, I turned back to Heroku.

[Read More]

Comparaison of Two Docker Images for Hugo

Having importing the repo for the Hugo theme Introduction from GitHub to GitLab, I added the automatically generated GitLab CI config file and I ran job #135854407.

$ cd exampleSite
$ hugo --themesDir=../.. -d ../public
hugo: /usr/lib/libstdc++.so.6: no version information available (required by hugo)
hugo: /usr/lib/libstdc++.so.6: no version information available (required by hugo)

The build succeeded with the above message. To suppress it, a switch to another CI runner will do. The associated GitLab CI config file was copied from Hugo’s documentation with some customizations for Hugo sample sites

[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

Staticman Lab New Logos

StaticmanLab new logo

StaticmanLab's new logo

GitLab logo recreated from Wikimedia's logo by Darby under CC-BY-SA 4.0 and Staticman logo on GitHub by Erlen Masson under MIT.

The old icon for Staticman Lab was made by GIMP from Staticman’s icon in PNG in the GitHub repo. Recently, I’ve found the SVG version of this icon. To serve customers better, I’ve recreated the logo from this SVG file so that the edges in the logo become sharper.

[Read More]

Nested Comments in Beautiful Hugo

  1. A minimal demo site on GitLab (Source)
  2. Beautiful Hugo pull request 222
  3. Pre-release notes for this pull request

Motivation

For the mathematical ones, please see my previous post.

As a math student, it’s inefficient to reinvent the wheel like engineering students. Thanks to three existing examples, I had convinced myself that I could bring this to the theme Beautiful Hugo.

Interactive Blog on Static Web Host

Vision

  • gain autonomy: freedom is the basis of moral actions. No freedom, no morality.
  • transcend ourselves: change/improve our lives through free thoughts

Goal

Convert our free thoughts into free code.

Free code allows users around the world to run and/or improve them. This would bring real enhancement to our tools.

For example, beautiful math writing used to be a complicated process. A decade ago, this required the installation of a typesetting engine called $\LaTeX$. Thanks to freely available scripts like MathJax and $\KaTeX$, it’s now possible to write math viewable by any modern web browser by writing the content in the middle.

[Read More]

Minimal Jekyll Site with Static Comments

Setup Staticman v3 and Jekyll on GitHub Pages

Introduction

This is the GitHub Pages version to my GitLab Pages with Staticman tutorial.

I didn’t plan to test whether Staticman v3 work on GitHub since it’s proprietary. However, from Staticman issues #222 and #227, we know that the official server doesn’t respond to

GET /v2/connnect/<USERNAME>/<REPONAME>

To help others, I self-advertised my own Staticman API instance and the migration to GitLab pages. Unfortunately, nobody had managed to create a GitHub repo running on my API instance. To convince others that it’s also working on GitHub, I decided to create a minimal GitHub repo.

[Read More]

Custom $\KaTeX$ Macros

More efficient math editing

Background

Same as the last section in Beautiful Hugo Improvements.

Goal

To write math efficiently by automatically loading longer code with shorter macro code.

For example, when I wrote Some Infinite Cardinality Identities, it would be ten times more quicker and efficient to type \card{C} than to write \mathop{\mathrm{card}}(C) all the time.

Changes committed to my repo

The current version of Beautiful Hugo is still using $\KaTeX$ v0.7, which doesn’t support macros in auto-rendering. It would be inconvenient to include the macros after invoking $\KaTeX$’s render function.

[Read More]
Hugo  KaTeX  math 

Better Hugo ToC Fix

A JavaScript free way to improve default ToC

Background

I applied a fix to Hugo’s ToC ten days ago.

Drawbacks

To make the script non-render blocking, one has to place it in the footer. As a result, it takes about 0.2 seconds to remove the excess <ul> tag.

Solution

Thanks to Beej126’s Hugo template code, this site delivers table of contents processed by Hugo during GitLab’s continuous deployment.

Hugo 

Staticman API Hosting 2018

Step-by-step guide for free-hosting on Heroku

Update: I suggest reading a newer tutorial for setting up your custom API server that works with GitHub Apps. The package maintainers suggest hosting your own API server.

Goal

To host an instance of Staticman v3 server on Heroku.

This post involves server-side setup of the commenting system. If you simply want to have a taste of this system on GitLab, you may try my demo GitLab Page.

I try to address some concerns about this API service in the introduction of this series to keep this page focused on the technical aspects of my customizations against staticman/dev branch.

[Read More]