Theme Components

After diving into the concept of theme components in the last few days, I had two thoughts.

First, the information on them is still fairly limited. The docs mention they are currently being updated, and there’s a thread in here about the docs and what they can do. Also one how-to article on creating them for a specific purpose as well.

While many of the existing theme components seem to add specific functionality to a site that it doesn’t have (json output for example), I started looking into them from once again cutting something I’d done in one theme to repeat in another, but more design than functionality.

That lead to my second thought that the current discussion about components is missing a potentially big use case: more easily reusable design components.

In the same way that partials can be reused inside a hugo theme, it seems you could set up a framework template with something like CSS grid and named areas. Then you could pick a sidebar component, a different header component, even a nav menu, and they would slide into place. Yes, some standards for naming, styling etc, would be needed but that’s where semantic tags help a lot.

I haven’t seen anyone discussing a use like this, but it seems quite possible. I know there’s been a few times when I’ve looked for a theme and ended up liking parts of 2-3 different ones. I can’t believe I’m the only one that seens the possibility in something like that. Could even lead to something like Wix/Squarespace built on top of hugo if someone put a GUI in front of it.