Re: [go-nuts] Prefer named variables or "with" in templates?

2025-05-26 Thread Paul Baker
> I'd consider both to be perfectly reasonable ways of going about > what you're doing. [...] And most of the time I would likely pick example 1 Thanks Nick. Example 1 is my preference as well - I'm a fan of the Zen of Python's "Explicit is better than implicit" and "Flat is better than nested".

[go-nuts] Prefer named variables or "with" in templates?

2025-05-25 Thread Paul Baker
I'm writing a simple Go template. Specifically, it's a Hugo shortcode that includes a page resource's content into a page, skipping a few lines. Both of these approaches work (but piping the output of `after` into `delimit` doesn't work, because `delimit` takes its arguments in the wrong order).