summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--languages/default.yml5
-rw-r--r--languages/zh-cn.yml5
-rw-r--r--layout/post.ejs41
3 files changed, 49 insertions, 2 deletions
diff --git a/languages/default.yml b/languages/default.yml
index e280019..73af215 100644
--- a/languages/default.yml
+++ b/languages/default.yml
@@ -1,4 +1,7 @@
next: Next Page
prev: Previous Page
listen: Listen Now
-read: Continue Read \ No newline at end of file
+read: Continue Read
+timeline: Timeline
+authors: Authors
+references: References \ No newline at end of file
diff --git a/languages/zh-cn.yml b/languages/zh-cn.yml
index c46f638..9d618fc 100644
--- a/languages/zh-cn.yml
+++ b/languages/zh-cn.yml
@@ -1,4 +1,7 @@
next: 下一页
prev: 上一页
listen: 现在收听
-read: 继续阅读 \ No newline at end of file
+read: 继续阅读
+timeline: 时间轴
+authors: 本期作者
+references: 相关资料 \ No newline at end of file
diff --git a/layout/post.ejs b/layout/post.ejs
index 008b20a..6997574 100644
--- a/layout/post.ejs
+++ b/layout/post.ejs
@@ -38,7 +38,48 @@
</script>
<% } %>
<section class="content is-size-6">
+
<%- page.content %>
+
+ <!-- Add podcast authors -->
+
+ <% if (page.podcast && page.podcast.authors) { %>
+ <h3><%= __('authors') %>: </h3>
+ <ul>
+ <% (page.podcast.authors).forEach(function(author) { %>
+ <li><%= author %></li>
+ <% }); %>
+ </ul>
+ <% } %>
+
+ <!-- Add podcast chapters -->
+ <% if (page.podcast && page.podcast.chapters) { %>
+ <h3><%= __('timeline') %>: </h3>
+ <ul>
+ <% (page.podcast.chapters).forEach(function(item) { %>
+ <%
+ const title = item[0];
+ const timestamp = item[1];
+ const hour = Math.floor(timestamp / 3600);
+ const minute = Math.floor((timestamp / 60) % 60);
+ const second = Math.floor(timestamp % 60);
+ const viewstr = String(hour).padStart(2, '0') + ':' + String(minute).padStart(2, '0') + ':' + String(second).padStart(2, '0');
+ %>
+ <li class="is-family-monospace"><a href="#t=<%= viewstr %>"><%= viewstr %></a> <%= title %></li>
+ <% }); %>
+ </ul>
+ <% } %>
+
+ <!-- Add podcast references -->
+ <% if (page.podcast && page.podcast.references) { %>
+ <h3><%= __('references') %>: </h3>
+ <ul>
+ <% (page.podcast.references).forEach(function(item) { %>
+ <li><a href="<%= item[1] %>" rel="noopener"><%= item[0] %></a></li>
+ <% }); %>
+ </ul>
+ <% } %>
+
</section>
<div class="level">
<div class="level-left">