diff options
| author | 135e2 <135e2@135e2.tk> | 2022-10-13 00:55:39 +0800 | 
|---|---|---|
| committer | 135e2 <135e2@135e2.tk> | 2022-10-13 00:55:39 +0800 | 
| commit | 1fa0c6cd4c93d37cb1aca86318476fa3b21c2b77 (patch) | |
| tree | 77962780f2172336fd886688b6105f4884378c85 | |
| parent | ad6ce523b72c36fe41cfcacb50cad95071ae57c6 (diff) | |
| download | chromate-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.ejs | 2 | ||||
| -rw-r--r-- | layout/post.ejs | 4 | 
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> | 
