mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-19 06:06:54 +00:00
feat: add support for embed spotify (#2515)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
{% endunless %}
|
||||
|
||||
<p>
|
||||
<audio class="embed-audio" controls>
|
||||
<audio class="embed-audio file" controls>
|
||||
{% assign extension = src | split: '.' | last %}
|
||||
{% assign types = extension | concat: types %}
|
||||
|
||||
|
||||
22
_includes/embed/spotify.html
Normal file
22
_includes/embed/spotify.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{% assign size = 352 %}
|
||||
{% assign theme = '' %}
|
||||
|
||||
{% if include.compact %}
|
||||
{% assign size = 152 %}
|
||||
{% endif %}
|
||||
|
||||
{% if include.dark %}
|
||||
{% assign theme = '?theme=0' %}
|
||||
{% endif %}
|
||||
|
||||
<iframe
|
||||
class="embed-audio spotify"
|
||||
src="https://open.spotify.com/embed/track/{{ include.id | append: theme }}"
|
||||
height="{{ size }}"
|
||||
frameBorder="0"
|
||||
allowfullscreen=""
|
||||
allowtransparency="true"
|
||||
allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
|
||||
loading="lazy"
|
||||
>
|
||||
</iframe>
|
||||
Reference in New Issue
Block a user