Skip to content

Commit 6048e81

Browse files
committed
feat: support spotify podcasts (#61)
1 parent 5e8664f commit 6048e81

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/jekyll-spaceship/processors/media-processor.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def on_handle_html(content)
3030
handle_vimeo(element)
3131
handle_dailymotion(element)
3232
handle_spotify(element)
33+
handle_spotify_podcast(element)
3334
handle_soundcloud(element)
3435
end
3536
doc.to_html
@@ -109,6 +110,19 @@ def handle_spotify(element)
109110
})
110111
end
111112

113+
# Examples:
114+
# ![spotify podcast](//open.spotify.com/episode/31AxcwYdjsFtStds5JVWbT)
115+
# ![spotify podcast](//open.spotify.com/episode/44gfWHnwbmSY7Euw6Nb39k?width=400)
116+
def handle_spotify_podcast(element)
117+
handle_media(element, {
118+
media_type: 'iframe',
119+
host: '(https?:)?\\/\\/open\\.spotify\\.com\\/episode\\/',
120+
id: '(?<=episode\\/)([a-zA-Z0-9\\_\\-]+)',
121+
base_url: "https://open.spotify.com/embed/episode/",
122+
height: 152
123+
})
124+
end
125+
112126
# Examples:
113127
# ![soundcloud](//soundcloud.com/aviciiofficial/preview-avicii-vs-lenny)
114128
def handle_soundcloud(element)

0 commit comments

Comments
 (0)