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/, 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]

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. [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. [Read More]

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 GitHub Actions for Hugo A Stack Overflow question showing pwd in GitHub Actions 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 arrowssyntax less well-knownTwo-way arrows $\rightleftarrows$ look odd array supported on Math.SE for a long timeeasier syntaxwrite basic diagonal arrows like $\nearrow$ fine tuning spacing is harddiagonal arrows only work for neighboring nodes ASCIIFlow WYSIWYG interface lines are rendered as slashes in code TikZ well known syntaxcan draw pretty diagrams not supported on SE, need to import as picture others? [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. [Read More]

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: Clicked on the “Action” tab of the repo. Chose the workflow file template for Jekyll. Added a slash / in front of srv in chmod 777 srv/jekyll, so as to fix the “no such file or directory” error. [Read More]

Customized Archetype for This Site

Background I prefer including the date into the Permalink of a post. Everytime I create a new post, I type hugo new post/$(date -I) to ensure that the date is correct. Problem The title field in the post’s front matter contained the date, which wasn’t something that I wanted because it’s already shown next to the icon. Observations Neither \d nor [\d] works for the PCRE character class \d. Solution I tried piping replaceRE, but I didn’t manage to get it work. [Read More]