Rendering page resources

#1

Hello,
I’m very new to hugo so I’m not sure if what I’m trying to do is correct. But it seems I’m not the only one. What I basically want to accomplish is having a “leaf bundle” with multiple resources of type “page” which I call “Render” of… (each of those “page” resources would have different layout files associated with them, so I don’t just want to render the .Content) but all I get is the following error message with hugo 0.44:

Building sites … ERROR 2018/07/17 23:49:15 Failed to render "index.html": programming error: no mainPageOutput for "landing/main/hero.md"
ERROR 2018/07/17 23:49:15 Stack Trace:
goroutine 61 [running]:/hugolib.stackTrace(0x4b0, 0x4c84f07, 0x17)
	/private/tmp/hugo-20180713-68487-o4xbkl/hugo-0.44/src//hugo/hugolib/page.go:280 +0x76
github.com/gohugoio/hugo/hugolib.(*Site).renderForLayouts.func1(0xc42041b8a0, 0xc4201b2000)
	/private/tmp/hugo-20180713-68487-o4xbkl/hugo-0.44/src//hugo/hugolib/site.go:1734 +0x135
panic(0x4b02bc0, 0xc42074bba0)
	/usr/local/Cellar/go/1.10.3/libexec/src/runtime/panic.go:502 +0x229
text/template.errRecover(0xc42041b790)
	/usr/local/Cellar/go/1.10.3/libexec/src/text/template/exec.go:143 +0x1ba
panic(0x4b02bc0, 0xc42074bba0)
	/usr/local/Cellar/go/1.10.3/libexec/src/runtime/panic.go:502 +0x229
text/template.errRecover(0xc42041a590)
	/usr/local/Cellar/go/1.10.3/libexec/src/text/template/exec.go:143 +0x1ba
panic(0x4b02bc0, 0xc42074bba0)
	/usr/local/Cellar/go/1.10.3/libexec/src/runtime/panic.go:502 +0x229/hugo/hugolib.(*Page).Render(0xc420162000, 0xc42074bb80, 0x1, 0x1, 0x0, 0x0)
	/private/tmp/hugo-20180713-68487-o4xbkl/hugo-0.44/src/hugo/hugolib/page_output.go:159 +0x163
reflect.Value.call(0x4c31d60, 0xc420162000, 0xf213, 0x4c37879, 0x4

but it seems to work in 0.40.2 … I have found a pretty similar bug report at https://github.com/gohugoio/hugo/issues/4861 and some description about the rendering example at http://discourse.gohugo DOT io/t/solved-how-to-use-the-new-resource-content-feature/11614

but in this discussion it seems like rendering pages inside bundles shouldn’t be supported anyway: discourse.gohugo DOT io/t/new-in-0-42-failed-to-render-default-list-html-programming-error-no-mainpageoutput/12836

so… is this a bug or a feature? I’m just learning hugo and i’m still pretty confused on how to structure my site… I think it would be really nice If I could make up my landing page out of rendered resources of sub pages…

(sorry for killing the URLs in this post, new users aren’t allowed to have more than two links in their posts…)

#2

It’s hard for me to tell what’s going on here. I’m not smart enough to read four different similar discussions and grasp how that relates to your use case.

Have you looked at requesting help? That has some good suggestions that help us help you. :slight_smile: