String / Variable Concatenation to build Path for partial

It’s difficult to provide proper help if you don’t share the source of your site (See Requesting Help).

But even then, see if this helps… you are missing passing any context to the partial. See Partial templates | Hugo

From there:

One of the most common mistakes with new Hugo users is failing to pass a context to the partial call. In the pattern above, note how “the dot” (.) is required as the second argument to give the partial context. You can read more about “the dot” in the Hugo templating introduction.

The “dot” passes the current context. If you want to pass more stuff in addition to that, you can pass a dict to the partial that includes the “dot” too.

Here’s a simple example of using dict for passing stuff to a partial.

The concepts of the context and dot and dict might to too many new things to learn… so take your time to read through the docs. Feel free to ask more questions if and as you find trouble following the documentation. The Hugo community is working hard to improve the documentation based on user feedback.

1 Like