rstudio / blogdown

Create Blogs and Websites with R Markdown
https://pkgs.rstudio.com/blogdown/
1.73k stars 335 forks source link

[FR] bookdown in blogdown #641

Closed hardin47 closed 2 years ago

hardin47 commented 3 years ago

I have a bookdown book that exists in the same GitHub repo as my blogdown.

  1. The index.html file that gets created when I run bookdown will nicely appear in blogdown (yay for embedding correctly, boo for no table of contents!). See:

image

  1. All other html files (created by bookdown) are not embedded in blogdown, although the URL for each of the pages is identical to the structure of the index file. See (yay for correct table of contents, boo for not embedding within blogdown):

image

  1. In particular, compare the blogdown embedding of the following two URLs:

https://m154-comp-stats.netlify.app/notes/index.html

https://m154-comp-stats.netlify.app/notes/wrang.html

Is this discrepancy in embedding behavior intended or is there a way to make everything have the same behavior?

Thank you!!!

yihui commented 2 years ago

Bookdown and blogdown projects are quite independent, e.g., you can't easily share the same navbar across bookdown and blogdown pages, because these pages are generated with totally different mechanisms. Since they are very independent, basically you only have two options: 1) link from one site to another and vice versa; or 2) embed one in another using <iframe>. Unfortunately, neither option is optimal (1 means different layouts and structures of the two sites, and 2 is usually bad reading experience). If I must choose one, I'd probably use the first option, i.e., add a link to the book on the blogdown site, and link back to the course site on the bookdown site.

I see that you were using the distill site (https://github.com/hardin47/m154-comp-stats/blob/master/index.Rmd#L5) but what I said above still applies.

hardin47 commented 2 years ago

Yes, I ended up using the