[英]Building Bookdown to HTML loses styled formatting
I have a large Bookdown document that I want to host on a website as an HTML file.我有一个很大的 Bookdown 文档,我想将它作为 HTML 文件托管在网站上。 I use
bookdown::gitbook
to build into a website and the local preview looks fine.我使用
bookdown::gitbook
构建到一个网站,本地预览看起来不错。 However, when I host the html files in the website, they seem to lose the HTML styling and look pretty bad.但是,当我在网站中托管 html 文件时,它们似乎丢失了 HTML 样式并且看起来很糟糕。 Any workaround to this?
有什么解决方法吗?
EDITED: Adding the yaml at the beginning of my Index.Rmd file:编辑:在我的 Index.Rmd 文件的开头添加 yaml:
---
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.找到了一个解决方案:将 Bookdown Gitbook 粉碎成一个独立的 html 文件以托管在静态站点上会导致糟糕的情况 + 额外的维护步骤,所以我最终放弃了静态站点,转而托管为 Azure 应用程序服务站点。 My steps:
我的步骤:
This solution offers these advantages:该解决方案具有以下优势:
I hope this is helpful to others as well.我希望这对其他人也有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.