summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author135e2 <[email protected]>2022-10-13 00:55:39 +0800
committer135e2 <[email protected]>2022-10-13 00:55:39 +0800
commit1fa0c6cd4c93d37cb1aca86318476fa3b21c2b77 (patch)
tree77962780f2172336fd886688b6105f4884378c85
parentad6ce523b72c36fe41cfcacb50cad95071ae57c6 (diff)
downloadchromate-1fa0c6cd4c93d37cb1aca86318476fa3b21c2b77.tar.gz
chromate-1fa0c6cd4c93d37cb1aca86318476fa3b21c2b77.tar.bz2
chromate-1fa0c6cd4c93d37cb1aca86318476fa3b21c2b77.zip
fix: check Chapter type
... to avoid the following error (while we don't have chapters): Uncaught ReferenceError: Chapter is not defined
-rw-r--r--layout/_partial/scripts.ejs2
-rw-r--r--layout/post.ejs4
2 files changed, 3 insertions, 3 deletions
diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs
index 5eeac9e..61aece8 100644
--- a/layout/_partial/scripts.ejs
+++ b/layout/_partial/scripts.ejs
@@ -46,7 +46,7 @@
<script defer src="/js/shikwasa.chapter.min.js"></script>
<link media="none" onload="media='all'" rel="stylesheet"
href="/css/shikwasa.chapter.min.css">
- <% } %>
+ <% } %>
<% } %>
<!-- Font Awesome delay loading -->
diff --git a/layout/post.ejs b/layout/post.ejs
index 3428ddf..67f1ed0 100644
--- a/layout/post.ejs
+++ b/layout/post.ejs
@@ -54,7 +54,7 @@
<% } %>
<script>
window.addEventListener("load", () => {
- if (chapters !== []) Shikwasa.use(Chapter);
+ if (typeof Chapter !== 'undefined') Shikwasa.use(Chapter);
// Check for local audio media url
let url = "<%= page.podcast.media.url %>";
@@ -105,4 +105,4 @@
</div>
</div>
</div>
-</div> \ No newline at end of file
+</div>