Bookdown在编制时会生成带有章节标题的索引文件,而不是“ index.html”

问题描述 投票:1回答:1

我正在用Bookdown将一个较长的报告编译成html文档,直到最近,用bookdown :: gitbook编织它都没有任何问题。不知道发生了什么。

代码运行没有错误,所有图和文件都根据需要生成,但是index.rmd生成为以第一个标题的ID(“ chapter00.html”)命名的.html文件,而不是“ index.html”。 ”。这意味着网站上传到github后无法正常工作。

如果文件名手动更改为“ index.html”,则一切都很好。

我的index.rmd文件如下:

--- 
title: "Eesti inimarengu aruanne 2019"
author: "Eesti Koostöö Kogu"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
documentclass: book
bibliography: [bibliography/bib_chapter23.bib, bibliography/bib_chapterXY.bib]
biblio-style: authoryear
biblatexoptions: [refsegment=chapter]
csl: keel-ja-kirjandus.csl
link-citations: yes
description: "Eesti inimarengu aruanne 2019"
css: eia.css
lang: et
---

# Sissejuhatus {-#chapter00 .chapter_section .intro_section}

_ bookdown.yml文件如下:

book_filename: "EIA_2019_digi"
language:
  label:
    fig: 'Joonis '
    tab: 'Tabel '
    eq: 'Valem '
  ui:
    chapter_name: ""
delete_merged_file: true

_ output.yml如下:

bookdown::gitbook:
  split_by: section
  split_bib: yes
  config:
    toc:
      collapse: subsection
      scroll_highlight: yes
      before: null
      after: null
      toolbar:
      position: fixed
      edit : null
      download: null
      search: yes
    sharing:
      facebook: no
      twitter: no
      google: no
      linkedin: no
      weibo: no
      instapaper: no
      vk: no
      all: ['facebook', 'google', 'twitter', 'linkedin', 'weibo', 'instapaper']
bookdown::pdf_book:
  includes:
    in_header: preamble.tex
  latex_engine: xelatex
  citation_package: natbib
  keep_tex: yes
bookdown::epub_book: default

关于导致问题的原因的任何见解?谢谢!

r rstudio r-markdown knitr bookdown
1个回答
0
投票

问题是,当您应该使用书本进行呈现时,您正在编织中书本项目。在R控制台中:

bookdown::render_book("index.Rmd")

检查输出的最后一行是类似于

Output created: docs/index.html
[1] "/my/path/mybook/docs/index.html"

这将从您的index.rmd文件生成一个index.html文件

((如果要使用github.io进行发布,请记住在Settings> Github Pages下设置Source master branch / docs folder

© www.soinside.com 2019 - 2024. All rights reserved.