Skip to content

Commit

Permalink
Prevent non-zero arg on returning partial
Browse files Browse the repository at this point in the history
As of Hugo .75 returning partial now requires a non-zero argument.
  • Loading branch information
regisphilibert committed Nov 5, 2020
1 parent e7d4653 commit c933777
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions partials/private/parse.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@
{{ $origin := . }}
{{/* We range on it via key and value */}}
{{ range $key, $value := . }}
{{/* As it's a not a slice, there is no potential imports, we can directly use parse */}}
{{ with partialCached "tnd-netlifycms/private/parse" . . }}
{{/* We merge the produced data with the newly created $map */}}
{{ if ne . $value }}
{{ $map = merge $map (dict $key .) }}
{{/* As it's a not a slice, there is no potential imports, we can directly use parse
We make sure the value is not emtpy. As of Hugo .75 returning partial now requires a non-zero argument
*/}}
{{ with . }}
{{ with partialCached "tnd-netlifycms/private/parse" . . }}
{{/* We merge the produced data with the newly created $map */}}
{{ if ne . $value }}
{{ $map = merge $map (dict $key .) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
Expand Down

0 comments on commit c933777

Please sign in to comment.