Hi Folks! I’m brand-new to Hugo but have lots of experience with tech in general and the web itself. I’m using Hugo to develop a brand-new website. I’ve only been working on it for five days now but a great deal of it is working great and looking good. Having been working as profession back in the 80s, the markdown language feels like an old friend and, of course, the CSS and HTML is clear and, at least in the theme I chose, really well ordered. It’s all good.
I’ve got one question I can’t figure out. I want to limit the list of categories (or tags) to just the first 15 items. I’ve been trying to use range to limit the list and the software gods are laughing at me because I’ve tried so many variations on a theme and all have resulted in a deadly error.
I’m pretty sure that my problem concerns scope but I don’t have enough experience with Hugo’s templating yet to figure it out.
If anyone has a snippet showing how to list just the first N numbers of items in one of the taxonomies, I’d be very grateful.
The list in the sidebar. We expect a lot of categories, so I just want to list the first 10. I’ve already created a link below the list that will take the reader to a page that lists all of the categories. That works fine.
What I’m hoping for is just a list of the first 10 categories. The default ordering is alphabetical, which is perfect.