jhudsl / OTTR_Template

OTTR for making courses! This is a template repo that helps people write 1 course but publish it in three places
https://www.ottrproject.org/
Creative Commons Attribution 4.0 International
15 stars 12 forks source link

Automatically open links to new tab #743

Closed howardbaek closed 4 months ago

howardbaek commented 4 months ago

(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.

https://github.com/jhudsl/OTTR_Template/assets/50791792/19f61a9e-3cd0-4612-90b0-1c80582d2601

My only question is 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?

Screenshot 2024-04-08 at 12 10 51 PM

github-actions[bot] commented 4 months ago

No broken url errors! :tada: Comment updated at 2024-04-08-19:11:45 with changes from 3d933ff45e72462d6a5b53d28cc96a20b7429f8a

github-actions[bot] commented 4 months ago

No spelling errors! :tada: Comment updated at 2024-04-08-19:11:47 with changes from 3d933ff45e72462d6a5b53d28cc96a20b7429f8a

github-actions[bot] commented 4 months ago

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 3d933ff45e72462d6a5b53d28cc96a20b7429f8a

howardbaek commented 4 months ago

Weird that in the GHA generated preview of the course website, the links do NOT open in new tab.

howardbaek commented 4 months ago

@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?

image

cansavvy commented 4 months ago

@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?

image

No. Don't commit those files to the PR! The files will be re-rendered after this PR is merged.