Lessons learned designing my own Mico.Blog / Hugo Theme
What I would approach differently next time I build a Hugo theme from scratch for Micro.Blog, and future work on my 1987 theme.

For the first year of my existence on micro.blog, I customised existing themes to do what I wanted. First the Paper and Anatole themes, then Outpost, before settling on Tiny. Tiny theme is great, but despite all of the customisation, it became super popular quickly, and I felt that my site looked like every other site on Micro.Blog. So I decided to build my own ‘1987’ theme from ground up which I wrote about at the beginning of the year.
I’d been meaning since then to write a summary of the things I’d do differently, as well as further improvements I’d still like to make. So here goes.
Lessons Learned
Design
Before building my theme, I started off by building a html/css only wireframe. Understanding how Hugo themes are structured now, that is not really necessary. In future I would skip this step and just create the design direct in the local Hugo build, which will save time.
Development
I started off my build by grabbing a copy of the blank theme repo for micro.blog from GitHub. The blank theme does not contain all of the files that a basic micro.blog theme uses though, which means that I cannot replicate that functionality in my local build. In future I would grab the missing files, as well as replacing the partials for custom headers and footers - so as not to have to remove those things from my design to work on the theme locally.
Variables
This point follows on from the previous. In my next build I would replicate micro.blog variables within the config.json file, so that I could create and use them locally without overwriting the variables in my html. An example would be the subtitle and image that appears in the hero banner on the front page. These are hard coded, but if I wanted to design a theme for distribution would need to be dynamically populated. There is lots being dynamically populated in the theme, this comment is really about information that is held inside the micro.blog account profile.
Microformats
I knew very little about MicroFormats when I started my design, and I do not know a huge amount more now. What I do know though is that the absence of microformat classes within my html stopped the ‘on this day’ functionality from working at all. I wasted a day winding micro formats back into my design.
Luckily I did not write the conversation script, I think I borrowed this direct from Tiny - if I had, I might well have broken webmentions functionality in the site too.
Category / Page Titles
As category archives are dynamically produced I wrote a script that will inject a subtitle based upon the title of the page. It’s a small thing, but because some pages and categories have the same title, they have the same subtitle too. I could probably eliminate this by filtering more accurately, though that would need better understanding of Go than I have - I’m not sure that I really need to learn that. It’s all @ericgregorich fault, I have a big PowerApps project in mind and need to spend my time learning that environment.
Micro.blog - @ericgregorichmicro.blog
Deployment
Deployment worked relatively well, I synchronised my repo from Github, and then added in the Micro.Blog features that were not enabled on my local build because of the points above. I did not know that if you install the theme as a plugin, you can auto-update it from Github. In future I would/will do this to simplify and minimise updates on a production site.
Future Work
To replace any statically populated content, reinstating the micro.blog / Go variables, and simulating the content of those variables in config.json in my local build.
Reinstall the custom theme as a plugin in micro.blog so that I can develop locally, and push updates to (and pull them from) Github.
I still need to update some of the archive page designs, I borrowed a little from Tiny as I had run out of time.
I’m not sure how much of my audience uses webmentions, reply through micro.blog/mastodon or by email. I’d like to investigate a lightweight comment system. Before looking into further I’m just waiting to see if the big forthcoming update from @manton negates the need for this.
I’d definitely like to introduce some form of pagination and/or taxonomy to the photos archive, that page is pretty big and long, and is a key feature (for me at least) of my site.
I might add reading time back into the site - at least for article length posts.
I’d also still like to explore customising the xml files to control how content is presented to micro.blog, and the wider fediverse from there.
Other than the above though, I’m pretty settled on my design for the first time. I’ve not felt the urge to constantly tinker with it over the last month.

Leave a reply
Have your own site? Link to this page and send a webmention — it'll appear here. Otherwise, use the form.