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][re 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]
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: 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)-post-title.md 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. [Read More]
Hugo 

Icon in Hugo Navbar

Motivation The original navbar in words took up half of the horizontal spaces of the viewport. I couldn’t add new items like “Tags” to display the tag list. Work Thanks to the pre field in Hugo Menus, one can easily add the icon as an HTML element by some editing on the template file. {{ range .Site.Menus.main.ByWeight }} {{ if .HasChildren }} <li class="navlinks-container"> {{ if .Pre }} <a class="navlinks-parent" title="{{ . [Read More]
Hugo  icons  navbar 

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]