Static Site Generators (SSG): Hugo and Eleventy Picks
-
Martin Hähne ☛ How To Add Search To Eleventy
If you have an Eleventy-based site, there are a few options you can take to add search to your page. One low-fi solution that I use on this website at the moment is based on a big JSON file and some JavaScript that searches through that JSON. This solution won't work so well for big-ish websites. This blog has about 2k posts and the full JSON-file is 1.3 MB at the moment. It works on my connection, but that's not nothing. So keep that in mind.
Here's how it works.
-
James Kerr ☛ SuperDB Website Build Review
I use Hugo for all my static site needs. It has downsides as well, but at least it’s fast, it lets me write standard HTML, CSS, and JS, and gives me good data structures for pages, sections, menus, markdown, metadata, and partials. The downside is having to write Go templates. It’s an awkward and verbose language. But the upsides are too good, so I’m getting over it.
While working on this, I discovered even more features of Hugo like the virtual union file system. That allowed me to render the docs in the site without moving the files into the website folder.
-
Cory Dransfeldt ☛ Dynamic pages with PHP and 11ty
When I moved this site to my own hosting I rewrote the dynamic code that had previously been handled by edge functions in PHP. To speed up build times and make things scale nicely as I add more content and pages, I recreated my media pages as an amalgam of PHP and Liquid templates that 11ty writes out as complete pages at build time.