A year ago, I urged fellow Hugo users to organize their websites by using page bundles. While it still may be a good idea for many others, it’s ceased to be the best course for me, so this site is now unbundled once again. In the end, it was a battle of comfort-and-convenience versus “best practices.”
Comfort-and-convenience kicked butt and took names.
As a result, this post now comes to you from:
. <-- The Hugo project folder
└─ content
└─ posts
└─ 2023
└─ 07
└─ big-unbundle.md
. . . rather than from:
. <-- The Hugo project folder
└─ content
└─ posts
└─ 2023
└─ 07
└─ big-unbundle
└─ index.md
This also required me to move my image files from within individual posts’ folders (where they were page resources) to the project’s assets/images/
folder (where they became global resources), so I had to change that images-handling code about which I wrote earlier this week.1
You can correctly assume that these changes involved a lot of grunt work. What made them worth it?
First, I no longer needed to use page bundles. That post from last year arose when I wanted to use Hugo’s Overlay
filter for automated creation of my pages’ social media images. At the time, page bundles made that easier. Since then, I’ve adopted a different method that gives me even better results; and I haven’t come up with another compelling reason for using page bundles other than because of that earlier post about using them. That wasn’t enough.
Second — and this is what got me to thinking about making the switch in the first place — it became inconvenient to keep each post as an index.md
file in its own folder. For example, when clicking on my content editor’s dock icon, this was the “recent files” list I might see:

Not very helpful, right?
Now, to be sure, I could also see them listed in this more helpful and informative way:

. . . but that was possible only after I’d actually opened the editor, as opposed to just clicking the dock icon.
Is that a petty reason even to think about doing such an about-face, much less actually to go through with it? Perhaps. But minor irritations of this nature, repeated day after day for months at a time, annoy me mightily; so there’s that.
Besides, I also find it more intuitive and, yes, more comfortable to manage an unbundled site’s overall file-storage arrangement, regardless of any other factors that may merit consideration. It’s the way I managed the site project for the overwhelming majority of its history before now. Despite my age, I typically am not someone who resists change, at least if I can understand a good reason for the change — but I do frequently object to change-for-the-sake-of-change, and this seemed to have become one of those cases.
Incidentally, for any curious soul who may wonder about how badly this reversion may have mangled the previous post’s code examples, all of which depended on the bundled arrangement: fear not. All I had to do was change a couple of lines in each example. Any reference to
.Page.Resources.GetMatch
(or$.Page.Resources.GetMatch
) changed toresources.GetMatch
. That’s all! ↩︎
Latest commit (5cd2d446
) for page file:
2023-07-27 at 8:31:54 AM CDT.
Page history