I have a large Bookdown document that I want to host on a website as an HTML file. I use bookdown::gitbook
to build into a website and the local preview looks fine. However, when I host the html files in the website, they seem to lose the HTML styling and look pretty bad. Any workaround to this?
EDITED: Adding the yaml at the beginning of my Index.Rmd file:
---
title: "Team Documentation"
author: "Maxx"
date: "Updated on `r Sys.Date()`"
knit: "bookdown::render_book"
site: bookdown::bookdown_site
bibliography: [book.bib]
biblio-style: apalike
link-citations: yes
colorlinks: yes
lot: yes
lof: yes
fontsize: 13pt
monofontoptions: "Scale=0.7"
description: "This is a collection of commonly used information and how-to documents"
output:
bookdown::gitbook:
self_contained: true
css: css/style.css
split_by: section+number
config:
toc:
collapse: section
before: |
<li><a href="./index.html">Documentation</a></li>
after: null
toolbar:
position: fixed
edit: null
download: null
search: yes
sharing: false
info: yes
bookdown::html_book:
css: css/toc.css
---
Arrived at a solution: Smashing the Bookdown Gitbook into a single self-contained html file to host on a static site was causing badness + extra maintenance steps, so I ended up ditching the static site and hosting as an Azure app service site instead. My steps:
This solution offers these advantages:
I hope this is helpful to others as well.