rstudio / bookdown

Authoring Books and Technical Documents with R Markdown
https://pkgs.rstudio.com/bookdown/
GNU General Public License v3.0
3.78k stars 1.27k forks source link

Fontawesome icons not showing in `bs4_book` #1474

Open bwu62 opened 2 months ago

bwu62 commented 2 months ago

Hey, apologies if this isn't the most relevant or informative issue report, but sometime in the past week or two it seems like some underlying style or script file used in bs4_book changed?

I'm pretty sure it's some underlying file because 3 months ago I copied the default bs4_book template and published it on a Github pages here mostly for personal use as convenient bs4_book documentation, and haven't modified it since, and it suddenly changed when I came back from a 2 week break to work on another bs4_book project.

I'm sure there are other changes, but the most significant that I noticed were the following:

I poked around the source code and developer console but couldn't figure out where the change traces to. Any help figuring out what changed and maybe how to revert it would be appreciated, thanks! :)

Edit: I checked a bunch of other bs4_books published online, including all the bookdown reference example books. All the anchor links there are broken too, in both Chrome and Firefox so I don't think it's a browser-side issue. Notably, some of the gitbook anchors still work so I think the issue is specific to something in the bs4_book template.

cderv commented 2 months ago

Thanks a lot for the heads up.

We did not change anything in bookdown directly AFAIK. Though it could be related to

I'll try to trace this anchor link breakage.

And also the mobile view if I can reproduce

cderv commented 2 months ago

It seems to be the fontawesome icons not showing 🤔

cderv commented 2 months ago

image

The fontawesome JS kit is not loading anymore : 403 error.

https://github.com/rstudio/bookdown/blob/5dcce0334144352d44a2c26ea658993fc528c49b/inst/templates/bs4_book.html#L29

@hadley do you know about this url you used for bs4_book()?

Should we maybe update to another method to not use this js kit and the fontawesome package maybe ? What do you use in pkgdown ?

hadley commented 2 months ago

No idea sorry. These days I'd recommend folks switch to quarto book.

bwu62 commented 2 months ago

Oh looks like it's back up and working again. Wondering if we should consider a different CDN for the fontawesome JS kit?

hadley commented 2 months ago

I think you should consider bookdown to be largely superseded by quarto books.

bwu62 commented 2 months ago

@hadley I understand quarto is the latest and greatest. However, currently I don't have time to overhaul my project and make the switch. Plus, I was under the impression from the Quarto FAQ page that R Markdown and bookdown have not yet been superseded and will continue to receive bug fixes. I think switching out the link for a better CDN may be an easy fix to significantly improve bookdown's stability for existing users.

hadley commented 2 months ago

I just realised that this is probably why I keep getting these emails:

Screenshot 2024-09-04 at 12 06 14

So yes, probably worth fixing by switching to the fontawesome package.