So basically to render a page I will need to fetch two documents. I would then render the page into the layout using Mustache.

I fiddled around with show functions for a while but couldn't figure out a way to get the layout document in the function. I then stumbled upon include_docs and I'm now trying to get this to work using a list function and a view. My map function is as follows:

I did a bit of googling and noticed that there was a bug in CouchDB where linked documents didn't get passed onto the list function. As far as I can tell, this should be fixed already. Is this a case of regression or me being retarded?