Upgraded to Hugo v0.135

Background

  1. 18 months ago, I used latest Docker image in GitLab container resgitry for Hugo extended at commit 168fe3d.
  2. Six years ago, I integrated static comments to this blog.
  3. Last week end, when my friend tested static comments here, she reported that @StaticmanLab’s GitLab token had been expired. As a result, I updated it and re-deployed my Staticman instance.

Problem

I wrote a sample comment containing math equations to test if it’s still working. The back-end processes were fine, but the site rebuilding wasn’t successful, as commit c531a0b reveals.

[Read More]
hugo 

Notes du Jour

Plus importante que les techno

Dans le classique schéma pour la gestion du projet, on met le besoin du client d’abord. C’est important de l’entendre avant de commencer le traf. Sinon, on risque de perdre des heures (ou pire des jours) sur une chose que le client ne valide pas. Avant d’y mettre l’effort, il est bon de lui montrer idée générale et de lui demander un avis, afin d’éviter de lui délivrer un produit qu’il ne veut pas.

[Read More]

Fixed Archetype Error for This Site

Background

In Customized Archetype for This Site, I was using

{{ slicestr .Name 11 | humanize | title }}

in the title attribute in my site’s archetypes/default.md, so that the first 11 characters (YYYY-MM-DD-) would be taken out if I type this command.

$ hugo new post/$(date -I)-<MY_POST_TITLE>.md

In practice, <MY_POST_TITLE> can be replaced to any title, like my-post-title.

Problem

I wanted to create my IntelliJ cheatsheet, so I typed this command.

[Read More]
Hugo 

Finding Pandoc Logo

Background

I’m writing my guide for preparing simple documents. I hope that users can prepare documents efficiently and the prepared documents look smart.

Problem

To help readers get my message in the linked guide, I used many icons from Font Awesome. However, it doesn’t include pandoc’s logo. I tried searching that using the search string “pandoc logo filetype:svg”. Duckduckgo couldn’t find any results. Luckily, Google found many SVGs. The first result linked to a relevant discussion on Google Groups. However, all posts were collapsed, and the desired SVG didn’t show up.

[Read More]
pandoc  SVG 

Katex Boxed Equations

Goal

To render a bordered box with multiple equations.

Background

My previous article about dot products contains some boxed math expressions: some are inline and some take up the whole line.

For inline math, that’s simple: either $\fbox{text}$ or $\boxed{a=1}$ will do. For displayed math, these two KaTeX commands will ignore the newline command \\.

Solution

A simple Google search ‘“katex” AND “box”’ saved the day. It led me to this relevant Stack Overflow question, whose accepted answer suggested the use of custom CSS. I copied the CSS class name boxedmath for my blog.

[Read More]
KaTeX  CSS 

Upgrade Font Awesome in Beautiful Hugo Theme

Technical adjustment to Font Awesome's official guide

Background

Beautiful Hugo comes with Font Awesome icons. However, it seems that it’s no longer maintained.

Goal

To upgrade Font Awesome to the current stable version (6.1.1).

Problem

The official guide for self-hosting Font Awesome Web Fonts + CSS suggests users to place the following files

filepath role
/fontawesome/webfonts/ Free Web Fonts
/fontawesome/css/all.min.css CSS file for using Free Web Fonts

into somewhere in my theme. The left column of the diagram features the folder assets/.

[Read More]

Deploy Hugo Theme exampleSite With Github Actions

Motivation

To test PRs on the upstream of a Hugo theme by setting up a testing branch.

Goal

To deploy a forked GitHub repo for a Hugo theme with exampleSite to GitHub Pages using GitHub Actions.

The whole article is based on my fork of Hugo Future Imperfect Slim.

References

  1. GitHub Actions for Hugo
  2. A Stack Overflow question showing pwd in GitHub Actions
  3. A Hugo Discourse post about testing exampleSite

Difficulties

I had failed for about ten times before I got the job done.

[Read More]

Ways to Draw Diagrams Displayed on Math.SE

I wanted to start a meta question, but I don’t see a point of that after viewing some related posts listed at the end of the next subsection.

Intended question

You may vote on your preferred way.

Ways Advantages Disadvantages
AMScd supported on Math.SE for a long time
  • no diagonal arrows
  • syntax less well-known
  • Two-way arrows $\rightleftarrows$ look odd
array
  • supported on Math.SE for a long time
  • easier syntax
  • write basic diagonal arrows like $\nearrow$
  • fine tuning spacing is hard
  • diagonal arrows only work for neighboring nodes
ASCIIFlow WYSIWYG interface lines are rendered as slashes in code
TikZ
  • well known syntax
  • can draw pretty diagrams
not supported on SE, need to import as picture
others?

Related questions:

[Read More]

Site Maintenance for Hugo v0.60

Background

I lacked motivation to keep this tweaked theme up with Hugo’s development after last summer. When I came back yesterday, I saw that some pages using Font Awesome icons were broken. Apart from that, the ToC list level problem resurfaced.

Fixed ToC

The solution that I had adopted no longer worked. Luckily, some users provided a shorter code in the later discussions. The one from user501254 caught me. I first tried to copy his code into the partial layout for ToC. However, nothing changed.

[Read More]
Hugo 

Set up GitHub Actions for Beautiful Jekyll

GitHub Actions provide CI/CD support, which might interest many GitHub users. I’ve applied for this feature a week ago. Luckily, my application for the trial was approved by GitHub. Tonight, I’ve found the motivation for making my first step in my forked repo VincentTam/beautiful-jekyll.

My setup:

  1. Clicked on the “Action” tab of the repo.
  2. Chose the workflow file template for Jekyll.
  3. Added a slash / in front of srv in chmod 777 srv/jekyll, so as to fix the “no such file or directory” error.
  4. Added the parameter repository: {your repo name} in the site config file _config.yml.

The action should be successfully configured.

[Read More]