-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically open links to new tab #743
Conversation
No broken url errors! 🎉 |
No spelling errors! 🎉 |
Re-rendered previews from the latest commit:
* note not all html features will be properly displayed in the "quick preview" but it will give you a rough idea. Updated at 2024-04-08 with changes from the latest commit 3d933ff |
Weird that in the GHA generated preview of the course website, the links do NOT open in new tab. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@howardbaek This is an excellent and much needed ad! Thanks so much for figuring this out in a way that's succinct.
@cansavvy I have one followup question. After running bookdown::render_book(), I get a bunch of rendered files in docs/, and I'm not sure whether I need to include the below files in this PR? |
No. Don't commit those files to the PR! The files will be re-rendered after this PR is merged. |
(Used this blogpost as a reference)
I added JS code to
assets/open-new-tab.html
inside the<script>
tag, and pointed this file out to bookdown by placing it in the appropriate field inside_output.yml
.I tested this works by running
bookdown::render_book()
and clicking on the links on the rendered HTML pages.Screen.Recording.2024-04-08.at.12.08.03.PM.mov
My only question is after running
bookdown::render_book()
, I get a bunch of rendered files indocs/
, and I'm not sure whether I need to include the below files in this PR?