Gatsby and Gitbook at the same site

Hello, I would really appreciate if you could help me. I need to add Gitbook documentation to my site, and I’m having trouble doing that. First I thought of using branch subdomains, however it seems that netlify doesn’t see my branch. I tried creating some new branches and it didn’t publish any of them. Next I thought of building gatsby and gitbook at the same time in netlify with command gatsby build && gitbook build , but gatsby is built on ‘public’ folder and gitbook on ‘_book’. Could you help me figure this out?

Hi there,

We’ll only see branches that we’ve already built in the dropdown to select a branch or enable a branch subdomain, so first build, then use.

You can do what you’re talking about though and it makes sense: gatsby build && gitbook build. You may then need to move some files around:

gatsby build && gitbook build && mv _book/* public/mybookpath

for example. This article talks more about your options during build - you can do anything you want in the unix shell including direct file manipulations. I also think it likely that you could configure gitbook or gatsby to output in a custom directory, and just have that happen automatically. Here’s the relevant config for gitbook, for instance: