Renaming reserved layout directories

Hugo is still fairly young at v0.15, so I don’t mind asking this question. ;-p

What do you guys think about eventually renamed and deprecating layouts/[partials|shortcodes] and moving to layouts/[_partials|_shortcodes]? That would make all “internal” layout directories start with an underscore to match layouts/_default and remove those reserved names from the the normal layout namespace. That way a user could have a content section called “shortcodes” or “partials.” It would also make the source tree easier to scan with the naked eye when looking for items in the layouts tree.

The Node Improvements discussion got me thinking about namespace issues, which is why I proposed using as a place for node content and front matter. I’m thinking we should use the underscore prefix whenever we have potential namespace conflicts.

Ping @bep, @spf13

1 Like

I’m all for renaming for good reasons, but knowing the shitload of work it was to do the mass renaming we did with variable- and function names in 0.15, it should be a good reason. Not sure if this reach the bar of importance. To me, the “_default” is the odd one that could be changed to “default”. We have a “_internal” that is really internal, the others are meant for end users and themes to fill in.

An uniform way of handling naming conflicts would be nice (I’m not married to the suggestion) – but I have yet to see any naming conflicts in the layout directory.

So, “internal” was not a good term for me to use. I guess “special” would be better.

I’m with you in that I’m just trying to think of a uniform way to denote “special” files and directories that could avoid potential naming conflicts. The longer we wait, the more interest we’ll pay on this debt.

Thinking out loud… I wonder if we could create a hugo fix command similar to go fix that would update deprecated API usages (and path names).