diff options
author | Doge <[email protected]> | 2021-05-08 01:21:15 +0800 |
---|---|---|
committer | Doge <[email protected]> | 2021-05-08 01:21:15 +0800 |
commit | 04ecc3472802ec02f943a63683d3e311bfc19613 (patch) | |
tree | c540479c0d72b6ded8ee25eb6cea95b474079870 /layout/post.ejs | |
parent | e93cc42f9225f22094a19746f01f5cca99eeba1f (diff) | |
download | chromate-04ecc3472802ec02f943a63683d3e311bfc19613.tar.gz chromate-04ecc3472802ec02f943a63683d3e311bfc19613.tar.bz2 chromate-04ecc3472802ec02f943a63683d3e311bfc19613.zip |
Add podcast player support
Thanks to Shikwasa :+1:
Diffstat (limited to 'layout/post.ejs')
-rw-r--r-- | layout/post.ejs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/layout/post.ejs b/layout/post.ejs index 0de6e5a..d83d694 100644 --- a/layout/post.ejs +++ b/layout/post.ejs @@ -2,10 +2,31 @@ <!-- Post thumbnail with lazayload support --> <div class="post-thumbnail" style="background-image: url('<%= page.thumbnail %>');"></div> + <!-- Podcast Player using Shikwasa --> + <% if (page.podcast) { %> + <div class="post-podcast-player"></div> + <script> + window.addEventListener("load", () => { + const player = new Shikwasa({ + container: () => document.querySelector('.post-podcast-player'), + audio: { + title: "<%= page.title %>", + artist: "<%= page.podcast.author %>", + cover: "<%= page.podcast.thumbnail %>", + src: "<%= page.podcast.media %>" + }, + fixed: { + type: "static" + } + }); + }, false); + </script> + <% } %> + <!-- Post title and content --> <div class="post-meta"> <div class="post-time"> - <%- date(page.date, "MMM, D YYYY" ) %> + <%- date(page.date, "MMM, D YYYY") %> </div> </div> <h1 class="post-title"><%= page.title %></h1> |