If I add, first 10 like below, it only gives 3 products as it limits the results in the range.
{{range first 10 .Site.RegularPages}}
{{if in .URL "boston"}}
{{partial "banner.html" .}}
{{end}}
{{end}}
I was thinking I need to apply first 10 after the if statement and do something like this, but I’m not sure what variable to use in the second range.
{{range .Site.RegularPages}}
{{if in .URL "boston"}}
{{range first 10 //not sure what to put here//}}
{{partial "banner.html" .}}
{{end}}
{{end}}
{{end}}
Well the and part of your if is a simple nested where, but for the or part I have no idea how to implement it. I think you should first take a deep look at the whole where documentation, then think about how to simplify your query.
What is it precisely that you’re trying to achieve? Can’t you do it simpler? If you explain with details (and with example frontmatters) maybe we can figure out something
But it’s a bit hard to figure out what you’re trying to do if we don’t know what $fileName and the params are supposed to look like
I’m fairly new to Hugo and coding in general. I usually spend hours on a problem and that includes reading the docs before asking on here. This is sort of a last resort. I guess what I fail to consider sometimes is that a code snippet is not enough. I often assume that the issue I’m experiencing can easily be solved by someone more experienced. But I get it.
In this instance, I can’t share the repo, but I’ve gathered that I should try and look at simplifying my code.
Some time it can, but when it’s not, access to a repo make it very easy to try and help, and it’s often fun. We’re answering those kind of threads because we like the challenge. But the absence of a repo often takes all the fun away.