1
0
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:
Alexander Fuks
2025-09-08 23:45:20 +04:00
committed by GitHub
parent 5f8ec7ffd3
commit cda62e28d1
4 changed files with 47 additions and 14 deletions

View File

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

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