DEV Community

CJ Davis
CJ Davis

Posted on

Getting Started with Dev.to's Stackbit Connection

You've probably noticed the new announcement from Dev.to about how You can now generate self-hostable static blogs right from your DEV content via Stackbit.

If you're someone like me who has thought about starting blogging but just haven't made the commitment yet, this seemed like a nifty project to check out. However there is one caveat in their guide on How To Generate A Site With Stackbit (at least when using Hugo and the Fresh theme): you actually need to have at least one post in your profile; otherwise the Netlify build will fail with Error: Error building site: failed to render pages: render of "section" failed: "/opt/build/repo/layouts/_default/blog.html:4:51": execute of template failed: template: _default/blog.html:4:51: executing "content" at <"/posts">: can't evaluate field Pages in type *hugolib.Page.

Instead of being a good citizen and opening a PR to handle the null instance (that's on the TODO list, though), I decided to check out Dev's editor and create my very first post! Figured this would be more interesting than a 'lorem ipsum' or 'hello world!', and maybe it'll help someone else.

Top comments (5)

Collapse
 
peter profile image
Peter Kim Frank

Wonderful and very meta first post! ๐Ÿ‘

Collapse
 
crevax profile image
CJ Davis

Thanks!

Collapse
 
davbree profile image
David Berlin • Edited

Great first post! ๐Ÿ˜„
This is indeed an issue with the Hugo site we're generating. Working on a fix!

Collapse
 
crevax profile image
CJ Davis • Edited

I checked the build image Netlify uses and their version of Hugo is a bit outdated (they're using 0.54.0 while the latest is 0.58.3). I was able to reproduce the error locally on 0.54.0 but not 0.58.3. I currently don't have the time to dig deeper into why the newer version works, but hopefully that helps your investigation!

Collapse
 
rhymes profile image
rhymes

This is absolutely amazing CJ, thanks for being so cool about this issue and welcome to DEV as a writer ๐Ÿ˜‰