From c2d220042cd0bc974f10c6b3880877fb27f33027 Mon Sep 17 00:00:00 2001 From: imzy Date: Thu, 15 Apr 2021 21:36:39 +0800 Subject: fix: undefined loadComments() in homepage (#326) --- assets/js/comments.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/comments.js b/assets/js/comments.js index fa44f9e..e8ba96e 100644 --- a/assets/js/comments.js +++ b/assets/js/comments.js @@ -1,6 +1,8 @@ window.addEventListener("DOMContentLoaded", event => { {{ if .Site.Params.autoLoadComments }} - loadComments() + if (typeof loadComments === 'function') { + loadComments() + } {{ else }} const commentsToggle = document.getElementById('load-comments'); -- cgit v1.2.3