Skip to content

Commit

Permalink
✨ Feat: add spotify shortcode support (resolve #450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Jun 8, 2024
1 parent 7e2e100 commit 678e2c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layouts/shortcodes/spotify.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- $type := cond .IsNamedParams (.Get "type") (.Get 0) -}}
{{- $id := cond .IsNamedParams (.Get "id") (.Get 1) -}}
{{- $width := cond .IsNamedParams (.Get "width") (.Get 2) -}}
{{- $height := cond .IsNamedParams (.Get "height") (.Get 3) -}}
<iframe src="https://open.spotify.com/embed/{{ $type }}/{{ $id }}" width="{{ default "100%" $width }}" height="{{ default "380" $height }}" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe>
{{- /* EOF */ -}}

0 comments on commit 678e2c0

Please sign in to comment.