Skip to content

Commit fad27d3

Browse files
CheariXsiril-teja
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 393748e commit fad27d3

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
@@ -86,9 +86,8 @@ @article{PhysRev.47.777
8686
altmetric={248277},
8787
dimensions={true},
8888
google_scholar_id={qyhmnyLat1gC},
89+
video={https://www.youtube-nocookie.com/embed/aqz-KE-bpKQ},
8990
additional_info={. *More Information* can be [found here](https://github.com/alshedivat/al-folio/)},
90-
acceptance={9/123},
91-
acceptance_rate={7\%},
9291
selected={true}
9392
}
9493

_config.yml

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

432433
# -----------------------------------------------------------------------------
433434
# 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)