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.
This commit is contained in:
CheariX 2024-04-15 19:47:23 +00:00 committed by GitHub
parent d6a08c8ca3
commit a03b2e78e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View File

@ -54,9 +54,8 @@
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}
}

View File

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

View File

@ -199,8 +199,10 @@
<a href="{{ entry.supp | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">Supp</a>
{% endif %}
{% endif %}
{% if entry.video %}
{% if entry.video and site.enable_video_embedding %}
<a class="abstract btn btn-sm z-depth-0" role="button">Video</a>
{% elsif entry.video %}
<a href="{{ entry.video }}" class="btn btn-sm z-depth-0" role="button">Video</a>
{% endif %}
{% if entry.blog %}
<a href="{{ entry.blog }}" class="btn btn-sm z-depth-0" role="button">Blog</a>
@ -307,7 +309,7 @@
</div>
{% endif %}
{% if entry.video %}
{% if entry.video and site.enable_video_embedding %}
<!-- Hidden video block -->
<div class="abstract hidden">
<div style="text-align: center;">{% include video.liquid path=entry.video class="img-fluid rounded z-depth-1" controls=true %}</div>