summaryrefslogtreecommitdiff
path: root/layout/index.ejs
diff options
context:
space:
mode:
authorDoge <[email protected]>2021-05-08 01:21:15 +0800
committerDoge <[email protected]>2021-05-08 01:21:15 +0800
commit04ecc3472802ec02f943a63683d3e311bfc19613 (patch)
treec540479c0d72b6ded8ee25eb6cea95b474079870 /layout/index.ejs
parente93cc42f9225f22094a19746f01f5cca99eeba1f (diff)
downloadchromate-04ecc3472802ec02f943a63683d3e311bfc19613.tar.gz
chromate-04ecc3472802ec02f943a63683d3e311bfc19613.tar.bz2
chromate-04ecc3472802ec02f943a63683d3e311bfc19613.zip
Add podcast player support
Thanks to Shikwasa :+1:
Diffstat (limited to 'layout/index.ejs')
-rw-r--r--layout/index.ejs13
1 files changed, 7 insertions, 6 deletions
diff --git a/layout/index.ejs b/layout/index.ejs
index ae1db98..42f1a4f 100644
--- a/layout/index.ejs
+++ b/layout/index.ejs
@@ -24,14 +24,15 @@
<!-- Post meta -->
<div class="post-meta">
- <% if (post.podcast && theme.podcast && post.duration) { %>
+ <% if (post.podcast && theme.podcast) { %>
<%
- const hour = Math.floor(post.duration / 3600);
- const minute = Math.floor((post.duration / 60) % 60);
- const second = Math.floor(post.duration % 60);
- const duration = hour + ':' + String(minute).padStart(2, '0') + ':' + String(second).padStart(2, '0');
+ const duration = post.podcast.duration;
+ const hour = Math.floor(duration / 3600);
+ const minute = Math.floor((duration / 60) % 60);
+ const second = Math.floor(duration % 60);
+ const viewstr = hour + ':' + String(minute).padStart(2, '0') + ':' + String(second).padStart(2, '0');
%>
- <div class="post-duration"><%- duration %></div>
+ <div class="post-duration"><%- viewstr %></div>
<% } %>
<div class="post-time">
<%- date(post.date, "MMM, D YYYY") %>