From a03b2e78e6cf1f1dfc411a7524917acffb612857 Mon Sep 17 00:00:00 2001 From: CheariX Date: Mon, 15 Apr 2024 19:47:23 +0000 Subject: [PATCH] feat: make video embeddings optional. (#2337) As discussed in #1181, I suggest to make embedding videos an optional feature. This behavior aligns well with recently merged PR #2312. Open questions: 1. I added a youtube link to `papers.bib`. Is this link okay? 2. I set `enable_video_embedding: false` as the default. I argue that privacy settings should be the default. Also, the current implementation of `video.liquid` only works for some very specific video URLs. For example, to embed youtube, specialized links must be used to avoid `X-Frame-Option` issues. This behavior can lead to a broken embedding, which would not look very nice. Feedback welcome. --- _bibliography/papers.bib | 3 +-- _config.yml | 1 + _layouts/bib.liquid | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/_bibliography/papers.bib b/_bibliography/papers.bib index 961f2fbb2e0cf..97bc49ea54666 100644 --- a/_bibliography/papers.bib +++ b/_bibliography/papers.bib @@ -54,9 +54,8 @@ @article{PhysRev.47.777 altmetric={248277}, dimensions={true}, google_scholar_id={qyhmnyLat1gC}, + video={https://www.youtube-nocookie.com/embed/aqz-KE-bpKQ}, additional_info={. *More Information* can be [found here](https://github.com/alshedivat/al-folio/)}, - acceptance={9/123}, - acceptance_rate={7\%}, selected={true} } diff --git a/_config.yml b/_config.yml index 94b9cc9849f90..f3c8113bc2521 100644 --- a/_config.yml +++ b/_config.yml @@ -410,6 +410,7 @@ enable_navbar_social: false # enables displaying social links in the navbar on t enable_project_categories: true # enables categorization of projects into multiple categories enable_medium_zoom: true # enables image zoom feature (as on medium.com) enable_progressbar: true # enables a horizontal progress bar linked to the vertical scroll position +enable_video_embedding: false # enables video embedding for bibtex entries. If false, the button opens the video link in a new window. # ----------------------------------------------------------------------------- # Library versions diff --git a/_layouts/bib.liquid b/_layouts/bib.liquid index c4d724cbea34e..3443f3ad4665c 100644 --- a/_layouts/bib.liquid +++ b/_layouts/bib.liquid @@ -199,8 +199,10 @@ Supp {% endif %} {% endif %} - {% if entry.video %} + {% if entry.video and site.enable_video_embedding %} Video + {% elsif entry.video %} + Video {% endif %} {% if entry.blog %} Blog @@ -307,7 +309,7 @@ {% endif %} - {% if entry.video %} + {% if entry.video and site.enable_video_embedding %}