Crash of Hugo 0.154.0

I have an inline partial (here is a stripped example) that worked ever since but crashes with Hugo 0.154.0 now

{{- define "partials/inline/leftmost_descendant" }}
  {{- $pages := .Pages }}
  {{- range $pages }}
    {{- with partial "inline/leftmost_descendant" . }}
	  {{- break }}
	{{- end }}
  {{- end }}
  {{- return "" }}
{{- end }}

It does not crash if I introduce additional brackets:

{{- define "partials/inline/leftmost_descendant" }}
  {{- $pages := .Pages }}
  {{- range $pages }}
    {{- with (partial "inline/leftmost_descendant" .) }}
	  {{- break }}
	{{- end }}
  {{- end }}
  {{- return "" }}
{{- end }}

Is this a Hugo bug or am I supposed to add those brackets now?

It’s a bug (a surprising one) and I will fix it, but a workaround would be to add the parens …

1 Like
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.