As someone new to Hugo, does anyone have suggestions of the best place/theme/repo to bootstrap a site from that brings together the main examples of ‘best practice’/latest Hugo features?
I’m noticing many themes etc are not using the latest features. Understandable, but makes it harder to get rolling with the current ‘best’ of Hugo. For instance, use of the Hugo pipeline for minification, fingerprints, grouping assets with content (perhaps) and structuring themes when you’re rolling your own site etc?
Hugo docs (the source code) has been my starting point so far, but not sure how representative that is. Any pointers much appreciated!
Developers use Hugo subjectively, but that’s true of all development. I think that James (and I) want examples at a lower level. For example:
Creating a TOC from the directory structure. I use the menu partial from Docdock because that’s the theme I started with. It took me a long time to understand how the partial works. Is there a better way? I don’t know, and I don’t have all the time in the world to look for one.
Reuse: Docdock has an excerpt shortcode, but it only has full support for markdown (I use asciidoctor) and it only allows one excerpt per content file.
Final comment: Using material from themes is excruciating, because developers don’t put comments in their files.
Is it a matter of learning or communication style? @jmalin, you have two questions right there, and I’d say post them (one at a time, in consideration of volunteers’ time). Then you get the specific answers you need.
Now, from my POV, I ask: why would we cover those specific questions in a “best practice guide”? Hugo isn’t like other systems, it is really a templating engine. That means power, with less convention. And while I have no doubt popular and useful design patterns will rise to the top, the project is not working in that space at the moment. There are still tons of good ideas to be added, and that means all the practices more or less stay relevant, but the “best” is a moving target.
Here’s another way of saying it: if we could, we would curate the list of best things. As it is, we these forums and a handful of knowledge fonts talking here.
And one more point: Hugo continues to work. A best practice for a 0.18 project is still the best practice. I’m not sure if many projects encounter that phenomenon. It means whatever curated list capturing “current” features of Hugo will need to be aggressively updated. For now, I’d pay attention to #tips-tricks (you can subscribe to the feed at https://discourse.gohugo.io/c/38-tips-tricks.rss).
Hmm… Note that you will possibly find the latest features in there, but that repo is very synthetic – as it is a “test bench” for my development stuff. So I would not call it best practice; also, I don’t think that repo has lots of the cool “Hugo pipes” features …