rstudio/bookdown.org

Adding published book to main page and removing old url

proback opened this issue · 3 comments

My book https://bookdown.org/roback/bookdown-BeyondMLR/ was recently published by CRC Press (https://www.routledge.com/Beyond-Multiple-Linear-Regression-Applied-Generalized-Linear-Models-And/Roback-Legler/p/book/9781439885383), and I'm wondering if it could be featured on the bookdown homepage? Its cover image can be found at https://images.routledge.com/common/jackets/amazon/978143988/9781439885383.jpg. Thanks for considering!

One related question... an earlier version of this book was also published on bookdown at https://bookdown.org/roback/bookdown-bysh/ (before the publisher suggested a name change). Is it possible to set up a re-direct from the old version to the new version, or is it cleanest just to delete the old version?

I'm sorry to ask this via Issues - I tried to use a pull request with staging.txt but was not successful...

yihui commented

We will be happy to list it on the homepage. Before we do that, would you recommend one more book from https://bookdown.org/home/archive/ to make the number of books on the homepage even?

For https://bookdown.org/roback/bookdown-bysh/, you could redirect the pages by yourself. This is what I used: https://github.com/yihui/rmarkdown-cookbook/blob/2c88c8159b2d30537a06315f0dd1a512b95fac10/_render.R#L15-L22

You may apply the similar trick to your bookdown-bysh book if you still have its _book directory:

r = '<body onload="location.pathname=location.pathname.replace(\'/bookdown-bysh/\', \'/bookdown-BeyondMLR/\');">'
for (f in list.files('_book', '[.]html$', full.names = TRUE)) {
  x = xfun::read_utf8(f)
  if (length(i <- grep('^\\s*<body>\\s*$', x)) == 0) next
  # patch HTML files in gh-pages if built on Travis, to redirect to bookdown.org
  x[i[1]] = r
  xfun::write_utf8(x, f)
}

Or you could delete it on bookdown.org.

Thanks for being willing to list our book on the homepage. As far as a second book, how about #63: https://rafalab.github.io/dsbook/

Thanks also for sharing your redirect trick. I tried for a while but couldn't get it working, so I'm thinking I'll try other approaches now. https://bookdown.org/roback/bookdown-bysh/ is already listed on exclude.txt, which is helpful, but the URL is still active for those who have bookmarked it or search google with the old name. Is it possible to "deactivate" the old URL, or should I consider rendering a new book that is essentially just a link to the new one?

I really appreciate your help!

yihui commented

You could make the old book private or delete it (search for "private" on this page https://bookdown.org/home/about/), although I suggest you redirect the pages if possible.

Anyway, your book is on the homepage now.