Hugo panic with Site.GetPage

Hello,

I have a small issue with the function GetPage. When I use the syntax {{ (.Site.GetPage "conditions-generales-utilisation.md").Content }} on a partial Hugo returns me :

 panic: reflect: Zero(nil) [recovered]    
 panic: reflect: Zero(nil) [recovered]     
 panic: reflect: Zero(nil)

Thanks (again!)

Try

{{ with .Site.GetPage "page" "conditions-generales-utilisation.md" }}
{{ .Content }}
{{ end }}
  • The with should prevent the panic
  • GetPage needs page Kind as first arg
1 Like

Thanks @bep !