I would like to add my book to my website, it's free content, and share it to the viewers of my website.
Is there a way to export Gitbook HTML CSS and JavaScript code and add it to Django?
I would like to add my book to my website, it's free content, and share it to the viewers of my website.
Is there a way to export Gitbook HTML CSS and JavaScript code and add it to Django?
If your using the legacy cli: running gitbook build builds your gitbook into a static site. This static site can then be hosted through Django using this answer (Django static page?).
Otherwise if your using gitbook.com it appears that they only support pdf exporting (https://docs.gitbook.com/features/pdf-export). This can be statically hosted too if you please, but given your use case I'd look at a static site generator which converts markdown into a blog or website. This can be statically hosted on Django using the same method as above.
The only viable way I found to bring Gitbook content within the main project website (i.e. https://myproject.com/docs) is ripping the Gitbook HTML content with wget
wget -p -r -l10 -E -k -nH "https://my-gitbook-project"
And later host it as static pages.
The resulting HTML may need some tweaks.
If you have content in multiple branches in multiple "spaces", then the branch selector will need to be replaced.
Even after wget, it's still a client-rendered ReactJS website, so SEO will be anyway inferior.
At the moment wget is the best workaround for Gitbook explicit refusal to implement subdirectory integration (i.e. myproject.com/docs, which is much better for SEO) as opposed to subdomain integration (i.e. docs.myproject.com).
Personally, I'm seriously considering migrating my documentation away from Gitbook at this point. Even if the two-way-sync with Github is very convenient.