bookdown icon indicating copy to clipboard operation
bookdown copied to clipboard

`bookdown::clean_book()` should ignore `.nojekyll` file used when deployed on github pages.

Open cderv opened this issue 4 years ago • 1 comments

Scenario:

  • Use docs/ as output_dir
  • Build the book
  • Manually adds .nojekyll inside the folder (related to https://github.com/rstudio/bookdown/issues/1092 for better config)
  • Push to Github
  • Publish docs/ as github pages

Cleaning the project should not remove the manually created jekyll file. This could be an option in clean_book(clean = TRUE, keep_nojekyll = TRUE)

cderv avatar Jun 30 '21 08:06 cderv

Using

resource_files:
  - .nojekyll

and file.create(".nojekyll") does not help.

For now, workaround is to set

file.create(bookdown:::output_path(".nojekyll"))

in a setup chunk.

So we could also offer a setup function to run for this

bookdown::use_github_pages()

that would do this

Or just export output_path and document.

cderv avatar Jun 30 '21 08:06 cderv