TL;DR: When you set pageContents to a string, layouts do not get applied to the page.
Hello, I just solved an issue I was having with this plugin. It took me awhile and I had to dig through several plugins before I figured it out.
You have to pass a buffer object for the pageContents option. If you pass a string, the layout plugin fails, silently, it's utf8 check. When I ran my build, my generated pagination page only had the string I passed, no html from the layout.
I suggest doing a typeof check for strings on the pageContents option and either throw an error or create a new buffer using the string.
BTW, Thank you for creating and maintaining this plugin!
I'd welcome a PR to convert strings to a buffer. I'm not sure if it's ever valid to use a string, I can't recall from memory if metalsmith works fine internally with a string but I feel like it does.
TL;DR: When you set pageContents to a string, layouts do not get applied to the page.
Hello, I just solved an issue I was having with this plugin. It took me awhile and I had to dig through several plugins before I figured it out.
You have to pass a buffer object for the pageContents option. If you pass a string, the layout plugin fails, silently, it's utf8 check. When I ran my build, my generated pagination page only had the string I passed, no html from the layout.
I suggest doing a typeof check for strings on the pageContents option and either throw an error or create a new buffer using the string.
BTW, Thank you for creating and maintaining this plugin!