椒盐豆豉

Add random post picker to Hugo without json index

September 20, 2023
重启电脑 | English
code | project | tutorial | hugo | blog

I want to add a random article picker to my blog as another way to discover past posts, aside from categories and tags on the right side and making it easier on mobile.

I couldn’t find a simple enough solution that suits my needs after brief Googling. The options I found were either to randomize at build time, which means the article doesn’t change with each click or refresh, or to generate a JSON index, which I had trouble with probably because my lack of understanding of Hugo.

I thought such a simple feature should be achievable with just JS + HTML, so I decided to write my own. Performance shouldn’t be an issue for a blog with a few tens to thousands of articles. Here’s a solution I came up with for reference.

...


How to setup RSS for notion blog using Zapier

March 28, 2022
English | 重启电脑
tech | tutorial

RSS has became an almost obsolete concept that most of my friends nowadays never heard of, which is a shame. It’s simple, clean, accessible with correct setup, and most importantly, a highly productive system for information consumption. Why do you need RSS # Compared to other information consumption form like feed from certain platforms (e.g. Instagram, Twitter) or newsletter, RSS (or atom) has a few clear advantages ...


The most unprofessional recruiter I’ve ever seen

June 9, 2021
English | 重启电脑
career | rant | software engineer

Throughout my career in tech industry, all of the recruiters I’ve worked with are decent, or at least professional enough to coordinate me and the recruiting teams in their company without issue. Sometimes they’re slow in response or sounded less passionate about the job, which I totally get, everyone gets burnt out sometime. The worst case, they ghost people after interviews, ...