Defer CSS loading with WordPress

So you’re learning about Critical Rendering Path, you have already optimized your WordPress theme’s stylesheet but still there are WordPress core CSS files that you want to lazy load. I have a present for you 🎁 One of several techniques is to load the stylesheet using media=”print” which tells the browser this file is meant […]

How to list recently edited pages in Hugo

The following snippet will list your Hugo site pages ordered by last modification date. You simply have to reverse it and limit to your liking. Shortcode themes/YOUR_THEME/layouts/shortcodes/last-edited-pages.html How to use?

Moving from Docusaurus to Hugo

For static generated sites I’m loving more everyday Hugo. It’s speed and zero JavaScript dependency (unlike Gatsby) is just what the doctor ordered. I have a private wiki for my, well, not public notes. The first version was done with WordPress (I even open sourced the theme). It worked okay, nice writing experience, one click […]

Generating book lists from my Goodreads profile

If you read books you have perhaps heard about, the site has book reviews, season awards, and more. The most interesting part is that you can track you read, currently reading and want to read books. Yes, you could use a notepad or a spreadsheet πŸ€·β€β™‚οΈ but using the site is nice. You can […]

How to create a news digest using RSS and GitHub Actions

One of my daily morning routines is to scan several news sites and read headlines to see if anything piques my interest. Or at least to have a vague recollection of topics happening nowadays. I go to Hacker News, The Verge, The Guardian… and others. A mixed bag, really of tech and world news. Because […]

How to defer scripts in WordPress

You don’t need me explaining you how important it is to defer scripts for performance. If your application doesn’t need render-blocking scripts you should simply defer them. Most of the WordPress blogs/sites do not need render blocking scripts, for toggling menu visibility, swapping emojis for SVG’s, embed media… All these can be deferred no problem. […]

How to create custom commands for Mac’s Spotlight

Out of the box doesn’t seem to be possible πŸ™ BUT! I’ve found a workaround that works almost as nicely πŸŽ‰ There are paid apps out there, but we as developers should do it ourselves πŸ‘¨πŸ»β€πŸ’» To learn from it and to feel like a hacker. πŸ’‘ Create a bash script I want to able […]

How to do multiple StaticQuery in Gatsby

If you need to do more than one GraphQL StaticQuery in Gatbsy you can assign each query to a name. Then simply access data.yourName and you’re ready to go. Here’s a full example of how I use it on my reviews site:

How to remove client-side JavaScript from Gatsby

I build my reviews site using Gatsby. It’s cool, the graphql is powerful but there’s something that was buggering me. Why does my static site need client-side JavaScript? There’s no reason for it. Gatsby will argue about faster route changing this way, sure. For a high-traffic site where users visit multiple pages on the same […]

How to set docs as homepage for Docusaurus

If you’d prefer to show the Docusaurus docs section as a homepage instead of the regular landing page, you can use the snippet below. There are several ways to do this. From a simply server redirect, to the a hacky JavaScript redirect to the much desired official approach down below. Official solution: configure the docs […]