Skip to content

Commit 5d905e5

Browse files
CheariXSuraj-Bhor
authored andcommitted
feat: make video embeddings optional. (alshedivat#2337)
As discussed in alshedivat#1181, I suggest to make embedding videos an optional feature. This behavior aligns well with recently merged PR alshedivat#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.
1 parent 397658b commit 5d905e5

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

_bibliography/papers.bib

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ @article{PhysRev.47.777
5454
altmetric={248277},
5555
dimensions={true},
5656
google_scholar_id={qyhmnyLat1gC},
57+
video={https://www.youtube-nocookie.com/embed/aqz-KE-bpKQ},
5758
additional_info={. *More Information* can be [found here](https://github.com/alshedivat/al-folio/)},
58-
acceptance={9/123},
59-
acceptance_rate={7\%},
6059
selected={true}
6160
}
6261

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ enable_navbar_social: false # enables displaying social links in the navbar on t
423423
enable_project_categories: true # enables categorization of projects into multiple categories
424424
enable_medium_zoom: true # enables image zoom feature (as on medium.com)
425425
enable_progressbar: true # enables a horizontal progress bar linked to the vertical scroll position
426+
enable_video_embedding: false # enables video embedding for bibtex entries. If false, the button opens the video link in a new window.
426427

427428
# -----------------------------------------------------------------------------
428429
# Library versions

_layouts/bib.liquid

+4-2
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@
199199
<a href="{{ entry.supp | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">Supp</a>
200200
{% endif %}
201201
{% endif %}
202-
{% if entry.video %}
202+
{% if entry.video and site.enable_video_embedding %}
203203
<a class="abstract btn btn-sm z-depth-0" role="button">Video</a>
204+
{% elsif entry.video %}
205+
<a href="{{ entry.video }}" class="btn btn-sm z-depth-0" role="button">Video</a>
204206
{% endif %}
205207
{% if entry.blog %}
206208
<a href="{{ entry.blog }}" class="btn btn-sm z-depth-0" role="button">Blog</a>
@@ -307,7 +309,7 @@
307309
</div>
308310
{% endif %}
309311

310-
{% if entry.video %}
312+
{% if entry.video and site.enable_video_embedding %}
311313
<!-- Hidden video block -->
312314
<div class="abstract hidden">
313315
<div style="text-align: center;">{% include video.liquid path=entry.video class="img-fluid rounded z-depth-1" controls=true %}</div>

0 commit comments

Comments
 (0)